Published in


Right Way to create Splash Screen on Android

As we all know splash screen is the user’s first experience of your application. It normally used to display some kind of progress before the application setup completely. As per Google material design spec, Splash Screen follows a pattern known called Launch Screen. You can find the specification here.

Common Mistake

In most of the application developers use splash screen to showcase brand icon or picture for couple of seconds. This is common practice which most of the developers are following. It is not a good idea to use a splash screen that wastes a user’s time. This should be strictly avoided.

With the common approach you may also lead the problem of blank white page appears during splash launching.

Right Way

The right way of implementing a splash screen is a little different. In the new approach specify your splash screen’s background as the activity’s theme background.

Also the root cause of blank white page problem is that your layout file is visible only after app has been initialized completely.

Do not create a layout file for splash activity. Instead, specify activity’s theme background as splash layout.


To implement above approach, first create an XML drawable splash_background.xml inside res/drawable folder:

<?xml version=”1.0" encoding=”utf-8"?>
<layer-list xmlns:android=”">

<item android:drawable=”@color/colorPrimary” />



In the next step, set splash_background.xml as your splash activity’s background in the theme. Add a new SplashTheme for your splash activity:

<resources>    <!-- Base application theme. -->    <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">        <!-- Customize your theme here. -->        <item name="colorPrimary">@color/colorPrimary</item>        <item name="colorPrimaryDark">@color/colorPrimaryDark</item>        <item name="colorAccent">@color/colorAccent</item>    </style>    <!-- Splash Screen theme. -->    <style name="SplashTheme" parent="Theme.AppCompat.NoActionBar">        <item name="android:windowBackground">@drawable/splash_background</item>    </style></resources>

Configure SplashTheme as your splash activity’s theme in your AndroidManifest.xml:

<?xml version="1.0" encoding="utf-8"?><manifest xmlns:android=""    package="com.androidjavapoint.splashscreen">    <application        android:allowBackup="true"        android:icon="@mipmap/ic_launcher"        android:label="@string/app_name"        android:supportsRtl="true"        android:theme="@style/AppTheme">        <activity            android:name=".SplashActivity"            android:theme="@style/SplashTheme">            <intent-filter>                <action android:name="android.intent.action.MAIN" />                <category android:name="android.intent.category.LAUNCHER" />            </intent-filter>        </activity>        <activity android:name=".HomeActivity" />    </application></manifest>

Create an empty activity for Splash without XML layout file. This class will simply redirect to home activity.

package com.androidjavapoint.splashscreen;import android.content.Intent;import android.os.Bundle;import;public class SplashActivity extends AppCompatActivity {    @Override    protected void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        // Start home activity        startActivity(new Intent(SplashActivity.this, HomeActivity.class));        // close splash activity        finish();    }}

Notice that we do not have setContentView() for this SplashActivity. View is displaying from the theme and this way it is faster than creating a layout.

If you look at the time splash screen displays is exactly the same with the time taken by app to configure itself because of a cold launch (very first launch). If the app is cached, the splash screen will go away almost immediately.

Hope using this article you will be able make your splash screen work in a right way.

All the code explained is available on GitHub.

Thanks for reading. To help others please click ❤ to recommend this article if you found it helpful.

Check out my blogger page for more interesting topics on Software development at

You can also find my Android Applications on play store




The (retired) Pub(lication) for Android & Tech, focused on Development

Recommended from Medium

Biswap Key Metrics — Explosive Growth!

How To Hire A Flutter Developer in 2022? (A Complete Guide)

Low-code Limits Customization Flexibility: Myth or Reality?

The idea of rigid vs flexible platforms in low-code development reflected via the road sign

Serverless Event-Driven Systems 🚀

Annotations in Java

Why did we choose FAST API over Flask and Django for our RESTFUL Micro-services

Write for TechWasti!!

READ Book >> Beginning Ethereum Smart Contracts Programming: With Examples in Python, Solidity, and…

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Ankit Sinhal

Ankit Sinhal

Senior Software Engineer at Walmart. Dreamer and Achiever..

More from Medium

TextView reveal animation on Android

Android — Text View

BookLogApplication: Connecting the dots with more logic

Android Firebase Analytics Integration