Question

This is a copy of my AndroidManifest.xml Any help as to why the launcher is not being recognized? I tried running the code without applying DEFAULT to any other activity but it's still not working.

    enter code here

    <application
        <activity
            android:name="project.shirsho.Menu"
            android:label="@string/app_name" >
        <intent-filter>
            <action android:name="project.shirsho.MENU" />

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

    </activity>
    <activity
        android:name="project.shirsho.MainActivity"
        android:label="@string/app_name" >
        <intent-filter>
            <action android:name="project.shirsho.MAINACTIVITY" />

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

    </activity>
    <activity
        android:name="project.shirsho.Splash"
        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="project.shirsho.Textplay"
        android:label="@string/app_name" >
        <intent-filter>
            <action android:name="android.intent.action.TEXTPLAY" />

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

</application>
Was it helpful?

Solution

You need to specify the MAIN and LAUNCHER in the the intent filter for the activity you want to start on launch by :

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

if you want that Splach Activity as your launcher , your manifest must be :

    <application>
        <activity
            android:name="project.shirsho.Menu"
            android:label="@string/app_name" >
    </activity>
    <activity
        android:name="project.shirsho.MainActivity"
        android:label="@string/app_name" >
    </activity>
    <activity
        android:name="project.shirsho.Splash"
        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="project.shirsho.Textplay"
        android:label="@string/app_name" >
    </activity>

</application>

OTHER TIPS

I believe that you are trying to make "project.shirsho.Menu" as the launcher activity, then it should be like:

<activity
        android:name="project.shirsho.Menu"
        android:label="@string/app_name" >
    <intent-filter>
        <action android:name="android.intent.action.MAIN" />

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

change,

<intent-filter>
        <action android:name="project.shirsho.MENU" />

to

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

Hope this helps! :)

This is how your application part should look like. If you use eclipse to develop in it will help you create this (androidManifest.xml)

<application
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name" >
    <activity
        android:name=".MainActivity"
        android:label="@string/app_name" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
    <activity
        android:name=".SplashActivity"
        android:label="@string/app_name" >
        <intent-filter>
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
    </application>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top