Skip to content

Instantly share code, notes, and snippets.

@DanishAmjad12
Last active July 23, 2018 08:32
Show Gist options
  • Save DanishAmjad12/1870955747067aba0b43623d0a35106e to your computer and use it in GitHub Desktop.
Save DanishAmjad12/1870955747067aba0b43623d0a35106e to your computer and use it in GitHub Desktop.
private int SPLASH_TIME = 1000;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_splash);
Thread timer = new Thread() {
public void run() {
try {
sleep(SPLASH_TIME);
} catch (Exception e) {
e.printStackTrace();
} finally {
if (SharedPref.getPrefForLoginStatus(SplashActivity.this)) {
ProjectUtils.genericIntent(SplashActivity.this, HomeActivity.class, null, true);
} else {
ProjectUtils.genericIntent(SplashActivity.this, LoginActivity.class, null, true);
}
}
}
};
timer.start();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment