Skip to content

Instantly share code, notes, and snippets.

@iamnaran
Created July 7, 2021 13:48
Show Gist options
  • Save iamnaran/6252363c316b6e07f12943036db4b077 to your computer and use it in GitHub Desktop.
Save iamnaran/6252363c316b6e07f12943036db4b077 to your computer and use it in GitHub Desktop.
Splash Activity
public class SplashActivity extends AppCompatActivity {
private final int SPLASH_TIME_OUT = 3000;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_splash);
new Handler().postDelayed(() -> {
Intent i = new Intent(SplashActivity.this, MainActivity.class);
startActivity(i);
finish();
}, SPLASH_TIME_OUT);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment