écran blanc vient avant les éclaboussures

Le problème principal est l'écran de démarrage s'affiche au bout de 2-3 secondes. Avant l'écran de démarrage d'un modèle vierge apparaît que je ne veux pas. Sinon il fonctionne très bien. Voulez juste pour retirer le cache de mise en page qui s'affiche avant le démarrage de la page.

MainActivity:

public class MainActivity extends Activity {

    private static String TAG = MainActivity.class.getName();
    private static long SLEEP_TIME = 5; //Sleep for some time

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        this.requestWindowFeature(Window.FEATURE_NO_TITLE); //Removes title bar
        this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);  //Removes notification bar

        setContentView(R.layout.activity_main);

        //Start timer and launch main activity
        IntentLauncher launcher = new IntentLauncher();
        launcher.start();
    }

    private class IntentLauncher extends Thread {

        @Override
        /**
         * Sleep for some time and than start new activity.
         */
        public void run() {
            try {
                //Sleeping
                Thread.sleep(SLEEP_TIME*1000);
            } catch (Exception e) {
                Log.e(TAG, e.getMessage());
            }

            //Start main activity
            Intent intent = new Intent(MainActivity.this, Login.class);
            MainActivity.this.startActivity(intent);
            MainActivity.this.finish();
        }
    }

}

en page principale

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:paddingBottom="@dimen/activity_vertical_margin"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    android:background="@drawable/splash"
    tools:context=".MainActivity" >

</RelativeLayout>

source d'informationauteur Somnath Pal | 2015-05-20