Android simple splash screen

Hi, I have seen that many android starters have problems in implementing their own splash screen in Android (as I had once).UPDATE: As Rafael noticed me, there is also an improvement to be made on the splash screen and this is when the user presses the back button on the splash screen, we should avoid calling the next activity.
Thank you Rafael!Here is a simple and clean way to do it:

 * Splash screen activity
 * @author Catalin Prata
public class SplashScreen extends Activity {

    // used to know if the back button was pressed in the splash screen activity and avoid opening the next activity
    private boolean mIsBackButtonPressed;
    private static final int SPLASH_DURATION = 2000; // 2 seconds

    public void onCreate(Bundle savedInstanceState) {


        Handler handler = new Handler();

        // run a thread after 2 seconds to start the home screen
        handler.postDelayed(new Runnable() {

            public void run() {

                // make sure we close the splash screen so the user won't come back when it presses back key


                if (!mIsBackButtonPressed) {
                    // start the home screen if the back button wasn't pressed already 
                    Intent intent = new Intent(SplashScreen.this, Home.class);


        }, SPLASH_DURATION); // time in milliseconds (1 second = 1000 milliseconds) until the run() method will be called


    public void onBackPressed() {

        // set the flag to true so the next activity won't start up
        mIsBackButtonPressed = true;


And the splash_screen xml looks like this:

<?xml version="1.0" encoding="utf-8"?>

<LinearLayout xmlns:android=""

And in order to get the title bar of the application down, just add he activity in your manifest and add the theme as you can see below:

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