I have 2 activities. The first activity is the LogoActivity
. After 3 seconds I start the second activity that is my MainActivity
.
private void startCountDown(int duration, int interval) {
CountDownTimer mCountDownTimer = new CountDownTimer(duration, interval) {
@Override
public void onTick(long millisUntilFinished) {
// nothing
}
@Override
public void onFinish() {
startActivity(MainActivity.class);
finish();
}
};
mCountDownTimer.start();
}
startActivity(Class mClass)
is a method that I created to start any activity just by giving the class.
Now I am in the MainActivity
. If I exit by pressing home button and return back I see the MainActivity
, but if I press back button from MainActivity
and reopen the app from background the LogoActivity
show up first.
I dont want the users to see the LogoActivity
everytime they press back button(button from phone, not activity) from MainActivity
and restore it from background.
Why is the LogoActivity
shown if I called finish()
?