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):
D
Save
C
A -> B
Is it possible?
Run operation B from D with the flag FLAG_ACTIVITY_CLEAR_TOP .
FLAG_ACTIVITY_CLEAR_TOP
Intent a = new Intent(this, B.class); a.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); startActivity(a);
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