How to remove certain actions from the stack?

Let's say that I have this set of actions:

A -> B -> C -> D 

Activity D has a Save button. After clicking on this button, I want to return two actions to the stack ( C and D are part of a wizard, so I want to delete both of them):

 A -> B 

Is it possible?

0
source share
2 answers

Run operation B from D with the flag FLAG_ACTIVITY_CLEAR_TOP .

 Intent a = new Intent(this, B.class); a.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); startActivity(a); 
+1
source

try ending them in onPause (). I think they will remove the actions from the stack, and on the button click the call of the activity you want to start using intentions

0
source

All Articles