Android Make a Splash Screen in Java

How to make a splash screen in android java – Android splash tutorial

image credit / Pixabay


A splash screen on android or a splash activity is an activity that is shown first when the app is opened.

It is not important to have a splash screen in android but having a splash screen can make your app look professional or standard, it can also be used as a waiting or progress indicator when an app is loading resources data in the background when launching.

This tutorial will help you to make a simple splash screen app.


How does a splash activity work?

As i mentioned above, splash activity is the first activity that is launched when an android app opened, the splash screen can be shown for some seconds to some minutes, or until the background loading of the app is complete, and then the splash Activity will open another activity, for example, the MainActivity – after a set time.

Some splash screen can be shown without an activity, for example – by changing some values in the resources folders, like – Styles.xml, colors, themes etc, but in this tutorial, we will learn to create a splash screen with set time.


So let’s begin the Splash tutorial


Start New android project

In android studio, start a new android project,

android new project
android start new project screenshot


Click Next and choose Empty Activity, click Next

pick activity android new project

Now wait until the project building finishes.


Create a New Activity

Select File > New > Activity > Empty Activity

This will be the Splash Activity of our app


Rename this activity to SplashActivity and click finish


Next step is editing the android manifest to set the SplashActivity as launcher Activity


Editing the Android Manifest

To load the splash Screen, the first activity (launcher activity) must be the SplashActivity. right now,  the first activity is MainActivity,  we need change the MainActivity to SplashActivity  in order for the Splash screen to be shown.

How to make an activity as launcher activity in android java

To make the SplashActivity as launcher activity, we need change it’s intent filter, to change the intent filter from MainActivity to SplashActivity, refer to this screenshot


Or you can copy this code to your manifest

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android=""

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

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





Next, we need edit the activity_splash.xml, and the files


Editing activity_splash.xml, and the

For the splash screen to show something when launched, we should add something like an imageview or textview or both into it. here we will add just a textview in the activity_splash.xml, so you can see the splash screen in action.

Open the activity_splash.xml and add this text view

        android:text="WELCOME SPLASH"
        tools:layout_editor_absoluteY="341dp" />



Open and enter this code below oncreate method

int SPLASH_TIME_OUT = 700;
       new Handler().postDelayed(new Runnable() {

            * Showing splash screen with a timer. This will be useful when you
            * want to show case your app logo / company

           public void run() {
               // This method will be executed once the timer is over
               // Start your app main activity
               Intent i = new Intent(SplashActivity .this, MainActivity.class);
               // close this activity
       }, SPLASH_TIME_OUT);


So this is it, if you have any questions, just drop a comment below

Related Posts

How to Export Project Zip from Android Studio

How to Export Source Code ZIP in Android Studio Sometimes, you will need export the source code of your android studio app project, to share it with…

Fix Plugin [id: ‘’, version: ‘7.1.3’, apply: false] was not found in any of the following sources

Here is how to fix Plugin [id: ‘’, version: ‘7.1.3’, apply: false] was not found in any of the following sources This error is caused by mismatching…

Get Age from Date of Birth in Java Android

Here is how to get a user’s age from date of birth If you need get a user’s age from a given date of birth string, this…

How to Check if String Array Contains a Specific String in Android

Here is how to get a specific value or String from Array in Android To check if a string array contains a specific string, you can use…

Make Android WebView Support Razorpay Payment

How to Support Razorpay Payment and UPI in Android WebView? Android webview is inexpensive and easy way to make apps for websites. But to support some specific…

Leave a Reply

Your email address will not be published. Required fields are marked *