今天弄闪屏时,在闪的时间内按下返回建闪屏停止,但是时间到了还会加载主程序,我不想在加载主程序,按返回键我想结束程序:
private static final int SPLASH_DISPLAY_TIME = 3000;
Handler ur = new Handler();
Runnable yourRunnable = new Runnable() {
public void run() {
mainIntent = new Intent(SplashScreen.this,MyApp.class);
SplashScreen.this.startActivity(mainIntent);
SplashScreen.this.finish();
overridePendingTransition(R.anim.fadein,
R.anim.fadeout);
}
};
ur.postDelayed(yourRunnable, SPLASH_DISPLAY_TIME);
然后
onDestroy 中调用
ur.removeCallbacks(yourRunnable);