Last active
July 23, 2018 08:32
-
-
Save DanishAmjad12/1870955747067aba0b43623d0a35106e to your computer and use it in GitHub Desktop.
This file contains 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
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