Hello everyone today i will show you how to create a splash screen in android.
This is one of the simplest ways to create a splash screen however there are another ways to create the splash screen.
Lets look at the code.

We need two layouts one for the splash screen and another for the first screen that comes after splash screen.

The splash screen layout will look like this.

<?xml version="1.0" encoding="utf-8"?>
    <ImageView android:src="@drawable/android"

Now the main.xml file.

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:text="Splash screen Demo from CoderzHeaven"

Now the main java file.

package pack.coderzheaven;

import android.app.Activity;
import android.os.Bundle;
import android.os.CountDownTimer;

public class SplashScreenDemo extends Activity {
    public void onCreate(Bundle savedInstanceState) {

	private void createFirstScreen()

	private void creatingSplashScreen()
		 new CountDownTimer(5000, 1000) {
                   public void onTick(long millisUntilFinished)

		     public void onFinish() {

Make sure you have an image named “android.png” or “android.jpg” in your res/drawable folder.



  1. Amit Sharma December 1, 2011 at 7:17 pm

    Great tutorial worked perfectly code is nice and small as compared to Thread Concept,this concept was nice.

    • James December 14, 2011 at 7:41 am

      Create the Virtual Device with high Virtual Memory heap size, this will solve the outofmemory problem.

  2. Amit Sharma December 1, 2011 at 7:18 pm

    Great tutorial easier than the Thread concepts

  3. 181 January 27, 2012 at 9:57 am

    Is it Possible to place some button in the main.xml and can be proceeded with that???

    Cos i tried keeping a Button in main.xml which will lead to another Screen(3rd page), but tat gives a Force Close.

    (Splashscree—>main—->screen3 = gives a Force Close)

    • James January 27, 2012 at 7:21 pm

      Check the Logcat for the reason of force close.
      or paste that error here so that I can look.

  4. Follen June 1, 2012 at 1:32 pm

    So,I should write codes in createFirstScreen() for my MainActivity,is that right?

    • James June 1, 2012 at 1:57 pm

      Yes, you are right Follen.

  5. Ervin February 22, 2013 at 3:34 pm

    after so many days of searching, i finally found the most simple and working one..thanks a lot

  6. Android Example October 5, 2013 at 11:37 am

    Very nice dude…

    I have also found one good link here….

    Splash screen – Android Example


Leave a Reply

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




Theme by HermesThemes

Copyright © 2018 CoderzHeaven. All Rights Reserved

Please wait...

Subscribe to our newsletter

Want to be notified when our article is published? Enter your email address and name below to be the first to know.