Android: How to disable the system splash screen on Android 12 or above?

Android: How to disable the system splash screen on Android 12 or above?

I've observed that many Android apps disable the system's splash screen when the app launches. It just shows a full-screen image when launched.

How can this be done?

Answer

On Android 12+ (API 31+), the OS enforces its own splash window, but you can make it fully transparent so only your own image shows. On Android 11 and below (API 30–), you can disable the preview entirely and use your own full-screen drawable.

Android 12+ (API 31+)

  1. Add the SplashScreen dependency
// app/build.gradle
dependencies {
  implementation "androidx.core:core-splashscreen:1.0.0"
}
compileSdkVersion 33
  1. Create a “blank” splash theme in values-v31/styles.xml:
<resources>
  <style name="Theme.MyApp.Launch" parent="Theme.SplashScreen">
    <!-- make the system splash fully transparent -->
    <item name="android:windowSplashScreenBackground">@android:color/transparent</item>
    <item name="android:windowSplashScreenAnimatedIcon">@android:color/transparent</item>
    <item name="android:windowSplashScreenAnimationDuration">0</item>
    <!-- immediately switch to your real app theme -->
    <item name="postSplashScreenTheme">@style/Theme.MyApp</item>
  </style>
</resources>
  1. Apply the theme to your launcher activity in AndroidManifest.xml:
<activity
  android:name=".MainActivity"
  android:exported="true"
  android:theme="@style/Theme.MyApp.Launch">
  <intent-filter>
    <action android:name="android.intent.action.MAIN"/>
    <category android:name="android.intent.category.LAUNCHER"/>
  </intent-filter>
</activity>

After that, the OS “splash” is effectively invisible and you can in your real Theme.MyApp use a full-screen windowBackground or a dedicated SplashActivity with any layout you like. Note: “Disabling” the system splash isn’t supported; this hack simply makes it transparent so only your own splash shows.


Android 11 and Below (API 30–)

  1. Define a splash theme (e.g. in values/styles.xml):
<style name="Theme.MyApp.Launch" parent="Theme.AppCompat.NoActionBar">
  <!-- your fullscreen splash image -->
  <item name="android:windowBackground">@drawable/splash_fullscreen</item>
  <!-- disable the preview window -->
  <item name="android:windowDisablePreview">true</item>
</style>
  1. Use it in the manifest just as above.

When windowDisablePreview is true, splash_fullscreen will show instantly without any default icon or white flash.

Enjoyed this question?

Check out more content on our blog or follow us on social media.

Browse more questions