没有启动活动中活动中

2023-09-04 23:13:39 作者:她占据了我的心

我无法找到任何问题,但它不断给我的错误没有启动的活动找到了!和推出仅同步应用程序包的设备上! 谁能解决这个问题???

I can't find any problem but it keep giving me the error "No Launcher activity found!" and "The launch will only sync the application package on the device!" can anyone solve this problem???

这是我Maniest

    <application
    android:allowBackup="true"
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" >

    <activity
        android:name="com.example.saikoro.MainActivity"
        android:label="@string/app_name" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.DEFAULT" />
        </intent-filter>
    </activity>

            <activity
        android:name="com.example.saikoro.StartUp"
        android:label="@string/app_name" >
        <intent-filter>
            <action android:name="com.example.saikoro.StartUp" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>

</application>

推荐答案

&LT;活性GT; 要启动通过应用程序列表上的图标的活性元素必须包含的的意图过滤器以下几部分组成两个的:

The <activity> element of the activity you want to launch through the icon on the app list must contain both of the following parts of the intent-filter:

<intent-filter>
    <category android:name="android.intent.category.LAUNCHER" />

    <action android:name="android.intent.action.MAIN" />
</intent-filter>

您当前的清单与目录 LAUNCHER 和行动的活动,但在不同的活动。一个在应用程序列表中的图标必须有他们两个。

Your current manifest has an activity with category LAUNCHER and action MAIN, but in different activities. The one with the icon in the app list must have them both.