Search code examples
androidsplash-screen

Intent_filter splash screen manifest Android


I have a main class and a splash screen. the splash doesn't want to show and I'm fairly certain its the manifest.

Any thoughts?

    <application


    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name" android:debuggable="true">
    <uses-library android:name="com.google.android.maps"></uses-library>
    <activity android:name="splash"></activity><activity
        android:label="@string/app_name"
        android:name=".Main" 
        android:theme="@android:style/Theme.NoTitleBar">
        <intent-filter >
            <action android:name="android.intent.action.MAIN" />

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

</application>

Solution

  • The intent filter applied to the activity called .Main makes it so the launcher will launch that as the Main activity in your application. To switch the focus you would have a manifest like the following:

    <application
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name" android:debuggable="true">
        <uses-library android:name="com.google.android.maps"></uses-library>
        <activity android:name="splash">
            <intent-filter >
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>        
        </activity>
        <activity
            android:label="@string/app_name"
            android:name=".Main" 
            android:theme="@android:style/Theme.NoTitleBar">
        </activity>
    </application>
    

    Take a close look at the way the intent filters are set up now. the splash activity is set as MAIN and will be categorized as LAUNCHER