Showing Splash Screen in Full Screen Mode using CountDownTimer in Android

September 4, 2012

In this article, we will create an Android application containing a splash screen. This splash screen will be run in full screen mode. It is resistant to screen rotation while splash screen is up. This splash screen is implemented using a simple Android API called CountDownTimer.

This application is developed in Eclipse ( 4.2.0) with ADT plugin ( 20.0.3) and Android SDK ( R20.0.3)

1. Create a new Android application project namely “SplashScreenDemo”

Create new Android Application Project namely "SplashScreenDemo"

Figure 1 : Create new Android Application Project namely "SplashScreenDemo"

2. Design application launcher icon

Design application launcher icon

Figure 2 : Design application launcher icon

3. Create a blank activity to define MainActivity class

Create a blank activity in this project

Figure 3 : Create a blank activity in this project

4. Enter MainActivity details

Enter MainActivity details

Figure 4 : Enter MainActivity details

5. Delete Android’s support library from the project, if exists

By default Eclipse ( 4.2.0) adds Android Support Library to¬† Android application project. For this application, we don’t need to use this support library. So the library file libs/android-support-v4.jar may be removed manually via ProjectExplorer by simply right click on the file and then clicking the menu item “delete”.

6. Update the file res/values/strings.xml

    <string name="app_name">SplashScreenDemo</string>
    <string name="hello_world">Hello world!</string>
    <string name="menu_settings">Settings</string>
    <string name="title_activity_main">MainActivity</string>
    <string name="title_activity_demo">Splash Screen Demo</string>
    <string name="splash_message">Welcome to Splash Screen Demo</string>
    <string name="demo_message">This is Demo Activity</string>

7. Update the layout in the file res/layout/activity_main.xml

<LinearLayout xmlns:android=""
    android:orientation="vertical" >

        android:contentDescription="Logo" />

        tools:context=".MainActivity" />

        android:padding="20dp" />


8. Create a new layout for the class DemoActivity in the file res/layout/activity_demo.xml

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android=""
    android:layout_height="match_parent" >

        android:text="@string/demo_message" />


9. Create an activity class namely DemoActivity in the file src/in/wptrafficanalyzer/splashscreendemo/

package in.wptrafficanalyzer.splashscreendemo;
import android.os.Bundle;

public class DemoActivity extends Activity{
    protected void onCreate(Bundle savedInstanceState) {

10. Update the class MainActivity in the file src/in/wptrafficanalyzer/splashscreendemo/

package in.wptrafficanalyzer.splashscreendemo;

import android.content.Intent;
import android.os.Bundle;
import android.os.CountDownTimer;
import android.view.Menu;
import android.view.Window;
import android.view.WindowManager;

public class MainActivity extends Activity {

    public void onCreate(Bundle savedInstanceState) {

        /** Hiding Title bar of this activity screen */

        /** Making this activity, full screen */

        /** Sets a layout for this activity */

        /** Creates a count down timer, which will be expired after 5000 milliseconds */
        new CountDownTimer(5000,1000) {

            /** This method will be invoked on finishing or expiring the timer */
            public void onFinish() {
                /** Creates an intent to start new activity */
                Intent intent = new Intent(getBaseContext(), DemoActivity.class);

                /** Creates a new activity, on finishing this timer */

                /** Close this activity screen */

            /** This method will be invoked in every 1000 milli seconds until
            * this timer is expired.Because we specified 1000 as tick time
            * while creating this CountDownTimer
            public void onTick(long millisUntilFinished) {


    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(, menu);
        return true;

11. Update the file AndroidManifest.xml

<manifest xmlns:android=""
    android:versionName="1.0" >

        android:targetSdkVersion="15" />

        android:theme="@style/AppTheme" >
            android:screenOrientation="nosensor" >
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />

            android:label="@string/title_activity_demo" >
                <category android:name="android.intent.category.DEFAULT" />

12. Screenshot of the application

Screenshot of the SplashScreen in Action

Figure 5 : Screenshot of the SplashScreen in Action

13. Download

14. Reference

How to hire me?

I am George Mathew, working as software architect and Android app developer at

You can hire me on hourly basis or on project basis for Android applications development.

For hiring me, please mail your requirements to

My other blogs

Android Knowledge Quiz

Ready to test your knowledge in Android? Take this quiz :

Tags: , , , , ,

8 Responses to Showing Splash Screen in Full Screen Mode using CountDownTimer in Android

  1. Android on September 10, 2012 at 11:15 pm

    Nice tutorial but there’s a problem with the TextView.the id is also passed into the ImageView using the android:layout_above and android:layout_below and my eclipse is complaining saying that there are no resources for the do i solve that problem

  2. Android on September 10, 2012 at 11:29 pm

    secondly,when i run the app,there are errors pointing in that direction.i deleted the id for the textview with the android:layout_above and below for the imageview but wen i ran it,the screen was black n

    • george on September 11, 2012 at 9:10 am

      Thank you for reporting the issue.
      The issue may be easily fixed by changing the layout(activity_main.xml) from RelativeLayout to LinearLayout.

  3. Android on September 11, 2012 at 3:22 pm

    i guss the problem i had was with my Eclipse.i downloaded a new one and tried it again word for word as u wrote n i had no errors but on run,the app forcefully the Mainfest.xml file,thr was an error saying u can’t also write an intent for the DemoActivity class because it requires no i removed it n ran it again.same time pls where did i go wrong.this is my manifest file

  4. Android on September 11, 2012 at 3:42 pm

    my manifest.xml file is written below

  5. Android on September 11, 2012 at 3:59 pm

    it works!!!!!!!!.

    but y doesn’t it work on android 3.0? i tried testing it on it just to see how it looks like because android 3.0 has a tablet i tried it on android 4.0 n it worked perfectly.thanks man n forgive my questions am just new to this

    • george on September 11, 2012 at 4:24 pm

      That is nice.
      Make it up in 3.0 also !!!

  6. sarath on May 28, 2013 at 12:21 pm

    i need to wait until the latitude>0.0 and longitude>0.0 how can i apply this code in it?

    thank you

Leave a Reply to george Cancel reply

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

Be friend at g+

Subscribe for Lastest Updates

FBFPowered by ®Google Feedburner