Search code examples
androidandroid-layoutandroid-manifestandroid-fragmentactivity

Intro Slider to be the first activity


Help me arrange the Android Manifest properly so that my app can initiate with an intro slider instead of going straight to the main activity.

My current Android Manifest code is as follows:

 <?xml version="1.0" encoding="utf-8"?>
    <manifest xmlns:android="http://schemas.android.com/apk/res/android"
        package="za.co.danchokoe.diskiquiz">

      <application
           android:allowBackup="true"
           android:icon="@mipmap/ic_launcher"
           android:label="@string/app_name"
           android:supportsRtl="true"
           android:theme="@style/AppTheme">
           <activity android:name=".MainActivity">
               <intent-filter>
                   <action android:name="android.intent.action.MAIN" />

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

          <activity android:name=".WelcomeActivity" />
           <activity android:name=".ResultPlayAgain" />
           <activity android:name=".ResultWon" />
           <activity android:name=".timeup"></activity>
       </application>
</manifest>

I have the code behind for my Introslider as a WelcomeActivity.java and the layout is named activity_welcome.xml.


Solution

  • Change the .MainActivity to .WelcomeActivity like this:

    <?xml version="1.0" encoding="utf-8"?>
    <manifest xmlns:android="http://schemas.android.com/apk/res/android"
        package="za.co.danchokoe.diskiquiz">
    
      <application
           android:allowBackup="true"
           android:icon="@mipmap/ic_launcher"
           android:label="@string/app_name"
           android:supportsRtl="true"
           android:theme="@style/AppTheme">
           <activity android:name=".WelcomeActivity">
               <intent-filter>
                   <action android:name="android.intent.action.MAIN" />
    
                   <category android:name="android.intent.category.LAUNCHER" />
               </intent-filter>
           </activity>
    
          <activity android:name=".MainActivity" />
           <activity android:name=".ResultPlayAgain" />
           <activity android:name=".ResultWon" />
           <activity android:name=".timeup"></activity>
       </application>
    

    With this modification if you start your app the first activity will be your WelcomeActivity.