Created
June 28, 2016 13:17
-
-
Save mahdimortazavi/e82cb0abb2a195bc92cebec7557d58ee to your computer and use it in GitHub Desktop.
Splash Screen Full Screen
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Splash extends Activity { | |
/** Duration of wait **/ | |
private final int SPLASH_DISPLAY_LENGTH = 1000; | |
/** Called when the activity is first created. */ | |
@Override | |
public void onCreate(Bundle icicle) { | |
super.onCreate(icicle); | |
requestWindowFeature(Window.FEATURE_NO_TITLE); | |
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, | |
WindowManager.LayoutParams.FLAG_FULLSCREEN); | |
setContentView(R.layout.splash); | |
/* New Handler to start the Menu-Activity | |
* and close this Splash-Screen after some seconds.*/ | |
new Handler().postDelayed(new Runnable(){ | |
@Override | |
public void run() { | |
/* Create an Intent that will start the Menu-Activity. */ | |
Intent mainIntent = new Intent(Splash.this,MainActivity.class); | |
Splash.this.startActivity(mainIntent); | |
Splash.this.finish(); | |
} | |
}, SPLASH_DISPLAY_LENGTH); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment