Hello. I have a problem and that is my SplashScreen I have. It is built as an intro and after 3 seconds it shows the main menu of the program. Anyway, if I press down Back or Home button during the time the SplashScreen shows, it closes, but the activity I have chosen to follow after the SplashScreen will still run after the three seconds.
My code: **UPDATED CODE**
Handler ur = new Handler();
myRun = 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(myRun, SPLASH_DISPLAY_TIME);
}
protected void onStop() {
super.onStop();
ur.removeCallbacks(myRun);
}
Even if I have an onStop() in this SplashScreen, the next activity will still run after the SPLASH_DISPLAY_TIME.
Since I changed the code I got Force Close after I pressed the Home button and the SplashScreen disappeared, also, I cannot launch my second activity.