Browse By

How to create Splash Screen in Android

Splash Screen is a screen normally launch when user starts application. Developer can put Splash screen to show user some kind of progress before the app loads completely. Some developer uses splash screen just to show case their app / company logo for a couple of second.

In Android, Unfortunately there is no built mechanism to show splash screen. We will  use Handler class to implement splash screen.

In this tutorial we will create simple android application which will display Splash screen for 5 seconds, then it will bring user to Home Screen of application. For implementing Splash Screen we will use Handler class and its method postDelayed, to make splash screen visible for 5 seconds.

Direct Download Full Source Code



How to create Splash Screen in Android

Create New Android Project

  1. Create a new project and fill the required details File ⇒ New ⇒ Android Project
  2. Open  splashscreen.xml (res/layout) make screen to behave like your splash screen by placing company logo and background color.
    <?xml version="1.0" encoding="utf-8"?>
    <LinearLayout xmlns:android=""
        android:layout_width="fill_parent" android:layout_height="fill_parent"
        android:background="#2185c5" android:orientation="vertical"
        <ImageView android:src="@drawable/logo" android:id="@+id/imageView1"
            android:layout_width="match_parent" android:layout_height="wrap_content"></ImageView>
        <TextView android:id="@+id/textView1" android:layout_width="wrap_content"
            android:text="Loading..." android:textColor="#fff"
            android:layout_height="wrap_content" android:layout_gravity="center"></TextView>
  3. Now open Activity class, create object of Handler class and call postDelayed() method to show splash screen for 5 seconds. After wait of 5 seconds, we will redirect user to HomeScreen and will finish current splash screen.
    package com.vrs.pulse7.splashscreen;
    import android.content.Intent;
    import android.os.Bundle;
    import android.os.Handler;
    public class SplashScreen extends Activity {
    	// Constant Value for Splash Screen time visibility
    	private static int SPLASH_SCREEN_TIME = 5000;
    	/** Called when the activity is first created. */
    	public void onCreate(Bundle savedInstanceState) {
    		// Create object of Handler class and call method postDelayed to make
    		// Splash Screen visible for SPLASH_SCREEN_TIME
    		new Handler().postDelayed(new Runnable() {
    			public void run() {
    				// This is method will be executed when SPLASH_SCREEN_TIME is
    				// over, Now you can call your Home Screen
    				Intent iHomeScreen = new Intent(getApplicationContext(),
    				// Finish Current Splash Screen, as it should be visible only
    				// once when application start
  4. Make sure you have created Activity class and respective xml file for GUI.
  5. Now execute Application.

    Splash Screen, will be visible for 5 seconds, then automatically will redirect to Home Screen

    Splash Screen, will be visible for 5 seconds, then automatically will redirect to Home Screen

Points to Remember

  • In Android, No Built in mechanism available for Splash screen
  • Use Handler or Thread class to make Splash Screen visible for few seconds.
  • postDelayed() used to called runnable after specified amount of time
  • Don’t forget to finish()  splash screen, once you redirect to Home Screen.

I hope you like this article. Share your views to to improve content.

Download Full Source Code




  • Shabbir Dhangot


    • vimal rughani

      Thanks Shabbir

  • harish

    hi sir i m new for android .please give me a complete source code of a splash screen.

    • vimal rughani

      hi harish, i have sent you full source code at your mail account.

    • vimal rughani

      I have added donwload link to post, please check that

  • Asif Hingora

    Superb…Great Work

    • Vimal Rughani

      Thanks Asif,