No Launcher activity found

你。 提交于 2020-01-22 03:41:10

问题


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>


回答1:


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.




回答2:


Change

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

with

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


来源:https://stackoverflow.com/questions/14955993/no-launcher-activity-found

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!