Splash
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
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