The first thing the user sees when launching your application is the splash screen. It not only forms the first impression, but also masks the loading time of the main content. You can implement a high-quality screensaver in several ways - from a simple static image to animated screens with a logo. However, many developers make critical mistakes: they use heavy graphic files, ignore adaptation to different screen resolutions, or incorrectly configure the display time. Android Studio You can implement a high-quality screensaver in several ways - from a simple static image to animated screens with a logo. However, many developers make critical mistakes: they use heavy graphic files, ignore adaptation to different screen resolutions, or incorrectly configure the display time.

In this article we will look at three main methods for creating screensavers in 2026: through Theme.AppCompat (Google's recommended approach), using Activity, and with using the library SplashScreen API for Android 12+. You will learn how to avoid common bugs, optimize performance and make a screensaver that will work correctly on 99% of devices - from budget smartphones to flagships with 144 Hz displays.

Why the standard approach with Activity is outdated

Previously, screensavers in Android were implemented through a separate SplashActivity, which was launched first and through Handler().postDelayed() went to the main screen. This method is still found in outdated tutorials, but it has critical drawbacks:

  • โš ๏ธ Application launch delay โ€”an artificial wait of 2-3 seconds irritates users and increases the failure rate.
  • ๐Ÿ“‰ Performance issues is unnecessary Activity occupies memory and can cause ANR (Application Not Responding) on weaker devices.
  • ๐ŸŽจ Inconsistency with Material Design guidelines โ€”Google recommends using themed screensavers (WindowBackground) instead of individual screens.

With the release Android 12 (API 31) Google presented an official SplashScreen APIthat solves these problems. However, to support older versions of Android (up to 11 inclusive), the custom theme method is still relevant. Next we will analyze both approaches.

๐Ÿ“Š What type of splash screen are you planning to implement?
Static image
Animation with logo
Interactive splash screen
Not decided yet

Method 1: Screensaver through a custom theme (supports Android 5.0+)

This is the most universal method that works on all versions of Android. The essence of the method: we create a special theme with a background image, which is applied to the main one Activity before it is completely loaded. Advantages:

  • โœ… No unnecessary Activity - saves memory.
  • โœ… Instant display of the splash screen - the user does not see a white screen.
  • โœ… Easy to adapt to different resolutions via drawable folders.

Implementation steps:

  1. Create a background image:

    Recommended resolution: 1080ร—1920 px (for portrait orientation). Save the file as splash_background.xml in a folder res/drawable:

    <layer-list xmlns:android="http://schemas.android.com/apk/res/android"
    

    android:opacity="opaque">

    <item

    android:drawable="@color/colorPrimary"/>

    <item>

    <bitmap

    android:gravity="center"

    android:src="@mipmap/ic_launcher_foreground"/>

    </item>

    </layer-list>

    Here ic_launcher_foreground is your logo (must be in a vector for scaling).

  2. Create a theme style:

    In a file styles.xml add:

    <style name="SplashTheme" parent="Theme.AppCompat.Light.NoActionBar">
    

    <item name="android:windowBackground">@drawable/splash_background</item>

    <item name="android:statusBarColor">@android:color/transparent</item>

    </style>

  3. Apply the theme in the manifest:

    B AndroidManifest.xml for your main Activity specify:

    <activity
    

    android:name=".MainActivity"

    android:theme="@style/SplashTheme">

    <intent-filter>

    <action android:name="android.intent.action.MAIN" />

    <category android:name="android.intent.category.LAUNCHER" />

    </intent-filter>

    </activity>

  4. Remove the theme after loading:

    B method onCreate() main Activity add:

    override fun onCreate(savedInstanceState: Bundle?) {
    

    setTheme(R.style.AppTheme) // Your main theme

    super.onCreate(savedInstanceState)

    setContentView(R.layout.activity_main)

    }

The splash_background.xml file was created in drawable|The SplashTheme was added to styles.xml|Theme was applied to MainActivity in the manifest|In onCreate() the theme is changed to main-->

โš ๏ธ Attention: If you use Jetpack Compose, replace setContentView to setContent {}, but the logic for changing the theme remains the same. Don't forget to test on devices with dark theme โ€”the splash screen background should adapt through android:drawable with the condition ?attr/isLightTheme.

With the release of Android 12 Google introduced the official API for screensavers - android.window.SplashScreen. This method automatically adapts to system settings (including dynamic colors in Material You) and guarantees a smooth transition to the main content.

Advantages SplashScreen API:

  • ๐Ÿš€ Optimized performance โ€”the splash screen is shown instantly, without delay.
  • ๐ŸŽจ Support for animations โ€” you can add a smooth appearance of the logo.
  • ๐Ÿ“ฑ Adaptation for all devices โ€”works correctly with cutouts, rounded corners and navigation gestures.

Instructions for use implementations:

  1. Add a dependency to build.gradle (Module: app):
    implementation 'androidx.core:core-splashscreen:1.1.0'
  2. Create a theme for the splash screen to themes.xml:
    <style name="Theme.App.SplashScreen" parent="Theme.SplashScreen">
    

    <item name="windowSplashScreenBackground">@color/purple_500</item>

    <item name="windowSplashScreenAnimatedIcon">@drawable/ic_splash_logo</item>

    <item name="postSplashScreenTheme">@style/Theme.App</item>

    </style>

    Where ic_splash_logo is your logo in vector (.xml or .webp).

  3. Apply a theme in the manifest:
    <activity
    

    android:name=".MainActivity"

    android:theme="@style/Theme.App.SplashScreen"

    android:exported="true">

    <intent-filter>

    <action android:name="android.intent.action.MAIN" />

    <category android:name="android.intent.category.LAUNCHER" />

    </intent-filter>

    </activity>

  4. Initialize SplashScreen in MainActivity:
    override fun onCreate(savedInstanceState: Bundle?) {
    

    super.onCreate(savedInstanceState)

    installSplashScreen() // This line adds the splash screen

    setContentView(R.layout.activity_main)

    }

Parameter Description Example value
windowSplashScreenBackground Splash background color @color/purple_500
windowSplashScreenAnimatedIcon Logo (supports animation) @drawable/ic_splash_logo
windowSplashScreenIconBackground Background color logo @android:color/white
windowSplashScreenBrandingImage Additional image (for example, slogan) @drawable/branding_text
๐Ÿ’ก

For smooth animation of the logo, use AnimatedVectorDrawable. Create a file ic_splash_anim.xml in res/drawable and specify it in the parameter windowSplashScreenAnimatedIcon. Example of animation: gradual appearance of the logo with the effect fade-in.

โš ๏ธ Attention: On devices with Android 12+ the system animation of the application launch (launch animation) may conflict with your screensaver. To disable the system animation, add a parameter to the theme. <item name="android:windowSplashScreenBehavior">splashScreenStyle</item>.

Method 3: Animated screensaver with Lottie (for advanced effects)

If you need interactive or complex animation (for example, loading with a progress bar, animated mascot), use the library Lottie from Airbnb. It allows you to embed vector animations in the format .json without loss of performance.

Advantages Lottie:

  • ๐ŸŽญ Any animations โ€”from simple loading to complex scenes.
  • ๐Ÿ“ฑ Light weight โ€”the file .json weighs less than .gif or .mp4.
  • โšก 60 FPS โ€”smoothness even on weak devices.

How to implement:

  1. Add dependency v build.gradle:
    implementation 'com.airbnb.android:lottie:6.1.0'
  2. Download the animation s site LottieFiles (for example, loading spinner or logo reveal).
  3. Create a separate one SplashActivity:
    class SplashActivity : AppCompatActivity() {
    

    override fun onCreate(savedInstanceState: Bundle?) {

    super.onCreate(savedInstanceState)

    setContentView(R.layout.activity_splash)

    val lottieAnimation = findViewById<LottieAnimationView>(R.id.lottie_splash)

    lottieAnimation.playAnimation()

    // Go to the main screen after the animation is completed

    lottieAnimation.addAnimatorListener(object : AnimatorListenerAdapter() {

    override fun onAnimationEnd(animation: Animator) {

    startActivity(Intent(this@SplashActivity, MainActivity::class.java))

    finish()

    }

    })

    }

    }

  4. Add markup to activity_splash.xml:
    <?xml version="1.0" encoding="utf-8"?>
    

    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"

    android:layout_width="match_parent"

    android:layout_height="match_parent"

    android:gravity="center"

    android:background="@color/white">

    <com.airbnb.lottie.LottieAnimationView

    android:id="@+id/lottie_splash"

    android:layout_width="200dp"

    android:layout_height="200dp"

    app:lottie_rawRes="@raw/splash_animation"

    app:lottie_loop="false"/>

    </LinearLayout>

How to optimize Lottie animation for Android

1. Reduce the number of keyframes in Adobe After Effects before exporting.

2. data-i="167">for acceleration on weak devices. app:lottie_renderMode="HARDWARE" for acceleration on weak devices.

3. For animations lasting >3 seconds, split the file into parts and download sequentially.

4. Test on devices with Android 8.0 โ€”lags most often occur there.

โš ๏ธ Attention: If the animation Lottie weighs more 500 KB, this can significantly increase the size. Optimize the file through the tool .apk. Optimize the file through the tool Lottie Optimizer or convert to AnimatedVectorDrawable for simple ones. effects.

Optimizing the splash screen: 7 rules for ideal UX

Even the most beautiful splash screen can spoil the impression of the application if it too slow or too flashy. Follow these rules:

  1. Display time โ‰  3 seconds:

    Forget about Handler().postDelayed(3000)! The splash screen should disappear as soon as the main content is loaded. Use ViewTreeObserver to track the layout's readiness:

    view.viewTreeObserver.addOnPreDrawListener(
    

    object : ViewTreeObserver.OnPreDrawListener {

    override fun onPreDraw(): Boolean {

    return if (viewModel.isReady) {

    view.viewTreeObserver.removeOnPreDrawListener(this)

    true

    } else {

    false

    }

    }

    })

  2. Adapt to the dark theme:

    B colors.xml add alternative colors for night folders:

    <color name="splash_background">#FFFFFF</color> 
    

    <color name="splash_background">#121212</color>

  3. Test on real devices:

    The emulator will not show the real download speed. It is especially critical to test on:

    • ๐Ÿ“ฑ Samsung Galaxy A-series (weak processors).
    • ๐Ÿ“ฑ Xiaomi Redmi with MIUI (aggressive memory optimization).
    • ๐Ÿ“ฑ Devices with 120 Hz displays (may flicker animation).

1. Show instantly (without a white screen).

2. Disappear immediately after loading content (do not wait for a fixed time).

3. Support all screen orientations (portrait/landscape).

4. Weigh no more than 1 MB (including animations).-->

Common mistakes and how to avoid them

Even experienced developers make mistakes when creating screensavers. Here TOP-5 bugs and their solutions:

Error Cause Solution
The screensaver flashes before showing White screen between the system launcher and yours Activity Use WindowBackground in the theme or SplashScreen API
Animation twitches Too complex animation for the weak GPU Simplify the animation or use HARDWARE render in Lottie
The splash screen does not disappear Not called setTheme(R.style.AppTheme) in onCreate() Check order of calls to MainActivity
Blurry logo Use a raster image instead of a vector Convert logo to VectorDrawable (.xml)
Does not work on Android 12+ Outdated method with Activity Migrate to SplashScreen API

If your screensaver is does not work on a specific device, check:

  • โœ… Version Android (on Android 10 and below SplashScreen API is not supported).
  • โœ… Availability android:exported="true" in the manifest for MainActivity.
  • โœ… Missing android:noHistory="true" โ€”this may interrupt the animation.

FAQ: Answers to frequently asked questions

Is it possible to make a splash screen with a progress bar?

Yes, but this requires a separate SplashActivity with custom markup. Example:

<ProgressBar

android:id="@+id/progressBar"

android:layout_width="match_parent"

android:layout_height="4dp"

android:indeterminate="false"

android:max="100"

android:progress="30"/>

Update progress in the background via AsyncTask or Coroutines.

How to make the splash screen transparent?

For a transparent splash screen in styles.xml use:

<item name="android:windowIsTranslucent">true</item>

<item name="android:windowBackground">@android:color/transparent</item>

Please note that on some devices (for example Xiaomi) this may cause artifacts.

Why does the splash screen appear twice?

This happens if you use both a theme and a separate SplashActivity. Solution:

  1. Remove SplashActivity from the manifest.
  2. Leave only the method with a custom theme or SplashScreen API.
How to add sound to the splash screen?

To play sound when showing screensavers:

val mediaPlayer = MediaPlayer.create(this, R.raw.splash_sound)

mediaPlayer.start()

โš ๏ธ Attention: The sound when starting an application can irritate users. Use it only if it is critical for branding (for example, in games).

How to test the screensaver on different devices without physical devices?

Use Firebase Test Lab for testing on virtual devices:

  1. Download .apk to Firebase Console.
  2. Select devices for the test (we recommend Pixel 4, Galaxy S10, Nexus 5X).
  3. Watch the video of the application launch.

This will help identify performance problems on weak devices.