Add the Dependancy :
//Splash ScreenAdd a new Theme for Splash Screen:
implementation 'androidx.core:core-splashscreen:1.0.0-beta01'
<!-- Splash Screen Theme -->Add this code in MainActivity.kt
<style name="Theme.App.Starting" parent="Theme.SplashScreen">
// Set the splash screen background, animated icon, and animation duration.
<item name="windowSplashScreenBackground">@color/white</item>
// Use windowSplashScreenAnimatedIcon to add either a drawable or an
// animated drawable. One of these is required.
<item name="windowSplashScreenAnimatedIcon">@drawable/splash_screen</item>
<item name="windowSplashScreenAnimationDuration">200</item> # Required for
# animated icons
// Set the theme of the Activity that directly follows your splash screen.
<item name="postSplashScreenTheme">@style/Theme.<YOURTHEME></item> # Required.
</style>
installSplashScreen()Add this code in Manifest.xml
<application
...
android:theme="@style/Theme.App.Starting">
Comments
Post a Comment