我最近下载了Android Studio 2.0并创建了一个新的启动应用程序,并没有自己添加任何代码.运行应用程序后,android studio成功地在模拟器上安装了APK,但没有启动应用程序,而是出现以下错误:
$ adb shell am start -n "com.example.muhammad.firstapp/com.example.muhammad.firstapp.MainActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
Unexpected error while executing: am start -n "com.example.muhammad.firstapp/com.example.muhammad.firstapp.MainActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
Error while Launching activity
Run Code Online (Sandbox Code Playgroud)
我在谷歌搜索它,发现它之前被问过,但提供的解决方案对我来说也不起作用.我也没有在AndroidManifest.xml文件中添加任何内容.
AndroidManifest.xml中
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.muhammad.firstapp">
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
Run Code Online (Sandbox Code Playgroud)
MainActivity.java
package com.example.muhammad.firstapp;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); …Run Code Online (Sandbox Code Playgroud) 当尝试退出Android Studio时,它会显示一个确认对话框,询问"你真的要退出吗?".当我试图退出android工作室时,我错误地检查了"不要再问我"复选框.现在,我想要回复确认对话框.我在文件 - >设置下检查了它,但我无法找到任何恢复该功能的选项.谷歌也用谷歌搜索了所有内容.