<application
android:allowBackup="true"
android:icon="@drawable/logo"
android:label="App Name"
android:roundIcon="@drawable/logo"
android:supportsRtl="true"
android:requestLegacyExternalStorage="true"
android:theme="@style/maintheme"
android:usesCleartextTraffic="true"
tools:ignore="GoogleAppIndexingWarning"
tools:replace="android:icon, android:allowBackup"
>
this activity is splash screen activity below
<activity
android:name=""
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
this activity is Folder activity activity below
<activity
android:name= ""
android:theme= ""
android:configChanges="orientation|keyboardHidden|screenSize"
android:exported="true" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".MainActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:exported="true">
</activity>
<activity android:name="" android:theme=""/>
<activity android:name="" android:theme="" android:configChanges="orientation|keyboardHidden|screenSize"/>
</application>
the problem is when the app run it show the splash screen and then it
show the app keep closing,it doesn’t start the main activity.
can i make the android manifest to make the splash screen show first and then the start main activity
4
Answers
the simple method to do is use this in splashscreenactivity.java
like this
You cannot use your manifest for this, you need to use an Intent.
Code Example that you need in your SplashScreen Activity:
Make Sure Your compileSdkVersion 31 and targetSdkVersion 30.
You can switch activities only from the java files.
Implement this in your
OnCreate
method.SplashActivity.java
AndroidManifest.xml