Launcher activity detected despite being declared in manifest.xml

In my application, I have the main action defined in the manifest.xml file as follows:

<activity
            android:name=".MainActivity"
            android:label="@string/guide_activity" >
            <intent-filter>
                <category android:name="android.intent.category.LAUNCHER" />
                <action android:name="android.intent.action.MAIN" />

                <action android:name="android.intent.action.SEARCH" />
            </intent-filter>
            <meta-data android:name="android.app.searchable"
                   android:resource="@xml/searchable"/>
        </activity>

when I start a project from eclipse connected to a real device or emulator, I get the following message in the console: No Launcher activity was found

what could be the reason for this?

+5
source share
1 answer

Divide the intent filter into two separate ones. If you mix them like this, the android will not determine that one of the two is a launch filter.

<activity
    android:name=".MainActivity"
    android:label="@string/guide_activity" >

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

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

        <meta-data android:name="android.app.searchable"
               android:resource="@xml/searchable"/>
</activity>
+15
source

All Articles