I have three activities A,B & C.Now the Task i have this form A,B and C,in default android "standard"mode The activities navigation takes place like this A->B->C->B->A.Now What I want here is when I went to Activity C from B,when i backPressed In activity I went to previous Activity i.e.,B But i want to come back to A from C.How to achieve this could anyone tell about this??
,I want to do through intent flags or if possible want to apply launchmodes for the activities,But i am confused which launch mode should i use to achieve this ?-could any one please help me in this
Thanks In Advance
Just launch a new intent and clear the activities in the stack.
Intent intent = new Intent(this, A.class);
intent.addFlags(IntentCompat.FLAG_ACTIVITY_CLEAR_TASK);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
startActivity(intent);
Use finish()
method when you start Activity C.
i.e.
Intent i = new Intent(ActivityB.this, ActivityC.class);
startActivity(i);
finish();
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