Skip to content

Instantly share code, notes, and snippets.

@prathamesh-mutkure
Created December 6, 2019 10:35
Show Gist options
  • Save prathamesh-mutkure/a09be503cc246f19ddc41308577cb9cb to your computer and use it in GitHub Desktop.
Save prathamesh-mutkure/a09be503cc246f19ddc41308577cb9cb to your computer and use it in GitHub Desktop.
package gci.omrs.splash;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
public class SplashActivity extends AppCompatActivity {
private static final int SPLASH_TIMEOUT = 3000;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_splash);
// This will load our Main Activity after specified time
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
// Intent for jumping to MainActivity
Intent intent = new Intent(SplashActivity.this, MainActivity.class);
startActivity(intent);
finish();
}
}, SPLASH_TIMEOUT);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment