Created
September 12, 2014 14:18
-
-
Save Joisar/3986712b80e2e4a03661 to your computer and use it in GitHub Desktop.
Splash
This file contains hidden or 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
public class SplashActivity extends Activity{ | |
private static final String TAG = "SplashActivity"; | |
private Handler mHandler; | |
private Runnable mRunnable = new Runnable() { | |
@Override | |
public void run() { | |
loadHomeScreen(); | |
} | |
}; | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.splash); | |
mHandler = new Handler(); | |
mHandler.postDelayed(mRunnable, 2000); | |
} | |
private void loadHomeScreen() | |
{ | |
mHandler.removeCallbacks(mRunnable); | |
mHandler = null; | |
startActivity(new Intent(SplashActivity.this, | |
MainActivity.class)); | |
finish(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment