Android 找不到启动程序活动。!启动将仅同步设备上的应用程序包。!
我正面临这个问题,请帮我解决。这是我的manifest.xml文件。 请帮帮我……非常感谢你的帮助Android 找不到启动程序活动。!启动将仅同步设备上的应用程序包。!,android,android-emulator,adb,Android,Android Emulator,Adb,我正面临这个问题,请帮我解决。这是我的manifest.xml文件。 请帮帮我……非常感谢你的帮助 <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.hello.myandroidnew" android:versionCode="1" android:versio
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.hello.myandroidnew"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="11" android:targetSdkVersion="18" />
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name="com.example.myandroidnew.MainActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAINACTIVITY" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".second"/>
</application>
</manifest>
将您的意向过滤器更改为以下内容:
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
区别在于行动。它必须是android.intent.action.MAIN,才能在启动器中列出。您必须正确设置操作名称,以便android知道它是主要活动。改变
<action android:name="android.intent.action.MAINACTIVITY" />
因此,您可以看到
action.MAIN
告诉android它是主入口点,即应用程序启动时显示的默认活动。但是活动的名称是MAINACTIVITY而不是MAIN。这无关紧要。您正在名称下的活动标记开头设置活动名称。操作完全不同。但是活动的名称是MAINACTIVITY而不是MAIN
<action android:name="android.intent.action.MAIN" />
<activity
android:name="com.example.myandroidnew.MainActivity"
public static final String ACTION_MAIN
Added in API level 1
Activity Action: Start as a main entry point, does not expect to receive data.
Input: nothing
Output: nothing
Constant Value: "android.intent.action.MAIN"