简体   繁体   中英

No Launcher activity found

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???

This is my 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>

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>

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.

Change

<action android:name="com.example.saikoro.StartUp" />

with

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM