AppStoreReady

Jetpack Compose Splash Screen with the SplashScreen API

Verified againstAndroid splash screens,Android: Migrate your splash screen to Android 12 and later,AndroidX Core release notes (core-splashscreen),androidx.core.splashscreen.SplashScreen referenceon November 4, 2026.

Compose has no splash composable of its own. The supported way to add a splash screen to a Compose app is the AndroidX core-splashscreen library: a Theme.SplashScreen theme in XML, then installSplashScreen() in your activity before super.onCreate() and setContent. The library brings the Android 12 splash screen to devices back to API 23.

1. Add the dependency

The current stable release is 1.2.0, listed on the AndroidX Core release notes (released November 5, 2025, with no newer version as of this check).

dependencies {
    implementation("androidx.core:core-splashscreen:1.2.0")
}
app/build.gradle.kts

2. Create the starting theme

Add a theme whose parent is Theme.SplashScreen. Use Theme.SplashScreen.IconBackground instead if you want a colored disc behind the icon. postSplashScreenTheme is the theme the activity switches to once the splash is installed, normally the theme your Compose app already uses.

<style name="Theme.App.Starting" parent="Theme.SplashScreen">
    <item name="windowSplashScreenBackground">@color/splash_background</item>
    <item name="windowSplashScreenAnimatedIcon">@drawable/ic_splash_logo</item>
    <item name="postSplashScreenTheme">@style/Theme.App</item>
</style>
res/values/themes.xml

Note the attribute names have no android: prefix here. These are the compat library's attributes, which work on every API level the library supports. The android:windowSplashScreen... versions are the platform attributes and only exist on API 31 and up.

AttributeWhat it sets
windowSplashScreenBackgroundA single opaque background color. Defaults to the theme's ?attr/colorBackground.
windowSplashScreenAnimatedIconThe centered icon. Static or animated (an AnimatedVectorDrawable). Defaults to the launcher icon.
windowSplashScreenAnimationDurationIcon animation length in ms. Needed on Android 12 (API 31 and 32) only. From Android 13 the duration comes from the AVD.
windowSplashScreenIconBackgroundColorColor of the disc behind the icon. Use it with Theme.SplashScreen.IconBackground.
postSplashScreenThemeTheme the activity uses after the splash.

Point the manifest at the new theme, on the <application> or only on the launcher <activity>:

<activity
    android:name=".MainActivity"
    android:exported="true"
    android:theme="@style/Theme.App.Starting">
    <intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LAUNCHER" />
    </intent-filter>
</activity>
AndroidManifest.xml

3. Install it before setContent

import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.activity.viewModels
import androidx.core.splashscreen.SplashScreen.Companion.installSplashScreen

class MainActivity : ComponentActivity() {
    private val viewModel: MainViewModel by viewModels()

    override fun onCreate(savedInstanceState: Bundle?) {
        val splashScreen = installSplashScreen()
        super.onCreate(savedInstanceState)

        // Checked before every frame: keep it cheap.
        splashScreen.setKeepOnScreenCondition { !viewModel.isReady.value }

        setContent {
            AppTheme { AppNavHost() }
        }
    }
}
MainActivity.kt

The order matters. Google's docs say to call installSplashScreen() before super.onCreate(); it is also the call that switches the activity to postSplashScreenTheme, so everything setContent draws uses your real app theme. Expose isReady as a StateFlow<Boolean> that turns true when local data such as settings has loaded. For network loads of unknown length, Google's advice is to dismiss the splash and show placeholders in Compose instead.

4. Optional: a custom exit animation

To run your own exit animation instead of the default, set a listener and call remove() when your animation ends. This version grows the icon while the whole splash view fades out, then removes it:

splashScreen.setOnExitAnimationListener { provider ->
    provider.iconView.animate()
        .scaleX(1.4f)
        .scaleY(1.4f)
        .setDuration(250L)
        .start()
    provider.view.animate()
        .alpha(0f)
        .setDuration(250L)
        .withEndAction { provider.remove() }
        .start()
}

Forgetting provider.remove() leaves the splash view over your Compose UI. The icon's own animation may still be running when the listener fires. On API 31 and up, provider.iconAnimationStartMillis and provider.iconAnimationDurationMillis tell you how much of it remains if you want to wait for it.

Preview the motion before you build it

Try 16 splash animation styles with your logo and export Android density PNGs. Processing runs in your browser. Exports are free one size at a time.

Open the Splash Screen Generator

Which assets this needs

The SplashScreen API does not take a full-screen image. It takes a background color and an icon that follows the adaptive icon geometry: 288 x 288 dp with the visible part inside a 192 dp circle, or 240 x 240 dp inside a 160 dp circle when you use an icon background. The Android 12 splash screen requirements page has the full numbers, including the animated icon limits.

The Splash Screen Generator exports full-bleed PNGs at density sizes from mdpi (360 x 800) to xxxhdpi (1440 x 3200). Those do not go into windowSplashScreenAnimatedIcon. Use them for a branded Compose screen you show after the system splash, such as an onboarding intro, for pre-12 layouts, or for cross-platform toolchains that take a full-screen image. Use the exported animation as the motion reference if you rebuild it as a Compose animation or an AVD.

Testing it

The splash only appears on cold and warm starts: when the app process is not running, or when it is running but the activity has not been created. It never appears on a hot start. Bringing the app back from the background while its activity is still in memory is a hot start, so you see no splash at all. Force-stop the app before each check.

Test on at least one device on Android 12 or later and one older device or emulator. Below Android 12 you are seeing the compat library's version, which draws the same layout but without icon animation. Check both light and dark system themes, and if you use setKeepOnScreenCondition, test with a slow first load (a delay in the ViewModel works) to confirm the splash holds and then releases instead of hanging.

Common display bugs

  • Two splash screens on Android 12+. You still have an old splash Activity. The system splash shows first, then yours. Remove it, or route through it with setKeepOnScreenCondition { true } so it never draws.
  • Icon is cropped. Content outside the inner circle is masked. Shrink the logo inside its vector canvas rather than the whole drawable.
  • Icon does not animate on older devices. Below API 31 the compat library shows the icon but cannot animate it. Put a static drawable in res/drawable and the AVD in res/drawable-v31.
  • Wrong color in dark theme. Put a night value for splash_background in res/values-night/colors.xml. The splash supports separate day and night resources.
  • A color flash after the splash. Check the window background of the theme postSplashScreenTheme points at. If it differs from your first Compose screen's background, that color can show for a frame between the two. Set the same color on both.

Related

Frequently asked questions

Should I build a splash screen as a composable?

Not as the launch screen. The system draws the splash before your first Compose frame exists, so a splash composable always appears after it, as a second screen. Use the SplashScreen API for launch and keep any composable intro short.

Does installSplashScreen work with ComponentActivity?

Yes. The compat library works with any ComponentActivity, including ones that set their UI with setContent. You do not need AppCompatActivity.

What is the minimum SDK for core-splashscreen?

Google documents that the library brings the Android 12 splash screen to all devices from API 23. On versions before Android 12, the icon is shown but cannot be animated.

How do I keep the splash screen visible while loading data?

Call setKeepOnScreenCondition on the object installSplashScreen returns, with a lambda that returns true until your data is ready. The lambda runs before each frame, so read a cached value instead of doing work in it.