My Application Flow:
Login->Profile->UpdateProfile->ChangePass
All of my activitys extends FragmentActivity
When I press button in ChangePass Activity I call this code:
Intent intent=new Intent(getApplicationContext(),LoginActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
startActivity(intent);
So It should start LoginActivity and when I press back from LoginActivity then Application should close...But When I press back button from Login Activity the flow is:
ChangePass->UpdateProfile->Profile->Login
Why My back stack is not cleared ?
Note:
I have applied all these solutions but not working: 1.link 2.link
Very late reply though.
But might help others as it worked for me.
Developers sometimes confuse FLAG_ACTIVITY_CLEAR_TASK
with FLAG_ACTIVITY_CLEAR_TOP
Use this insteadintentRestart.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NEW_TASK);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With