Wednesday, February 25, 2015

ANDROID code to create SPLASH screen

public class SplashScreenActivity extends Activity {
   
    private final int SPLASH_SCREEN_TIME = 1000;
   
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.splashscreen_activity);
        //splashScreenHandler.sendEmptyMessageDelayed(0, SPLASH_SCREEN_TIME);
       
        new Handler().postDelayed(new Runnable(){
            @Override
            public void run() {
                Intent mainIntent = new Intent(SplashScreenActivity.this,MainActivity.class);
                SplashScreenActivity.this.startActivity(mainIntent);
                SplashScreenActivity.this.finish();
            }
        }, SPLASH_SCREEN_TIME);
    }        
}

No comments:

Post a Comment