Search code examples
javaandroidclassinterfacesplash-screen

Set another Class to Main Class Android


i made a splash screen for my app (i know that it is not that important), so i made a new class .. it does not show error on android studio now .. the only problem i have is .. how can i change that (splash screen) class will show first before the main class ?? ..

i followed a quick tutorial about making a splashscreen on another website and this is what my XML and CLASS structure looks like, PS i decided making a splash screen right after my app is already made, so i am editing my app .. thanks


Solution

  • If you want the "splashScreen" activity to be the entrance of your application, add the declaration as the following to your manifest.xml

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