How to add a splashscreen to Android applications

In this post I’m showing you how to add a simple splash screen to you application / game.

You need the splashscreen file, a layout file and to modifiy AndroidManifest.xml accordinly.  All this will be provided here.

I’m assuming that your main activity is named

The splashscreen is showed in the listing bellow. Change the package name according to your own structure (see lines 1, 3 and 4).

On line 21 you can see I’m calling a layout named splash.xml.

Listing 1 –

The splash.xml layout file is on listing 2. It must be in the res/layout folder under you project.

Listing 2 – splash.xml layout file.

Notice that line 21 references a file named splah. It’s the name of your image used in the splash screen. Be sure to add it under res/drawabe folder. I recommend you using a .png file.

Note: you should add other versions of splash.png file to other drawable folders to contemplate other screen resolutions (drawable-hdpi, drawable-ldpi, drawable-mdpi).

The next step need in ordr to show the splash screen and after some seconds () call the main activity is to change the AndroiManifest.xml file.

Listing 3 shows the needed code you have to add.

Listing 3 – AndroidManifest.xml

Pay attention to line 1 in listing 3. You must change the package name to matche yours.

And that’s it.

I hope it help you.


3 thoughts on “How to add a splashscreen to Android applications”

  1. Thanks for this great tutorial. Nice, straight forward and to the point.

    one question though…

    having successfully incorporated this into my game (i added a new class SplashScreenActivity, a splash.xml in layout and made additions to the manifest) after running i get 2 apks installed, one with the splash and one without. if i merge the content of SplashScreenActivity i still get 2 apks the one that did have the splash crashes, and the one without runs fine.

    hope you can shed some light on this


    1. cracked it… i had left the original LAUNCHER in the manifest. without that i get one functioning apk – with a splash screen

      thanks again for the tutorial


Leave a Reply

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