Monday, 25 May 2015

Android Splash Screen Example


Here I am going to explain the implementation of android splash screen


package com.Splash;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;

public class SplashScreen extends Activity 

{
private static int SPLASH_TIME_OUT = 2000;

@Override

protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_splash);

new Handler().postDelayed(new Runnable() {


@Override

public void run() {

Intent i = newIntent(SplashScreen .thisFirstActivity.class);

                       
startActivity(i);

overridePendingTransition(R.anim.abc_fade_in, R.anim.abc_fade_in);

                                                                    
finish();
}
}, SPLASH_TIME_OUT);
}


}


Happy Coding :)