Skip to content

Instantly share code, notes, and snippets.

@crgarridos
Created August 19, 2015 08:23
Show Gist options
  • Save crgarridos/c1d97dd12acde7341f51 to your computer and use it in GitHub Desktop.
Save crgarridos/c1d97dd12acde7341f51 to your computer and use it in GitHub Desktop.
Simple Splash Activity
public class SplashActivity extends BaseActivity {
private final int SPLASH_DISPLAY_LENGHT = 1000;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
// Create an Intent that will start the MainActivity.
Intent mainIntent = new Intent(SplashActivity.this, MainActivity.class);
SplashActivity.this.startActivity(mainIntent);
SplashActivity.this.finish();
}
}, SPLASH_DISPLAY_LENGHT);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment