Created
February 2, 2015 13:33
-
-
Save louisbl/36a11ce2b86328aa7e4a to your computer and use it in GitHub Desktop.
Splash with timeout
This file contains hidden or 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 SplashActivity extends FragmentActivity { | |
private static final int SPLASH_TIME_OUT = 1500; | |
@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 = new Intent(SplashActivity.this, HomeActivity.class); | |
// start Home Activity | |
startActivity(i); | |
// close the splashscreen | |
finish(); | |
} | |
}, SPLASH_TIME_OUT); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment