2

Let's say that I have this stack of activities:

A -> B -> C -> D

The activity D has a Save button. After click on that button I want to get back two activities in the stack (C and D are part of some kind of wizard so I want to remove them both):

A -> B

Is this possible?

user219882
  • 15,274
  • 23
  • 93
  • 138

2 Answers2

2

Launch the activity B from D with FLAG_ACTIVITY_CLEAR_TOP flag..

Intent a = new Intent(this, B.class);
a.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
startActivity(a);
Ron
  • 24,175
  • 8
  • 56
  • 97
0

try finishing them in the onPause() . I think they will remove the activities from the stack and on the button click call the activity that you want to start using intents

G_S
  • 7,068
  • 2
  • 21
  • 51