anel
anel

Reputation: 173

Android: Keep multiple instances of an activity in the back stack

I have an Activity A from which I start Activity B. In Activity B I want to start a new instances of B (with different contents), so that I can navigate back to different instances of B. For example:

A -> B (with content x) -> B' (with content y) -back-> B (with content x)

My problem:

For an example navigation path:

A -> B -> B' -> B''

when pressing back in B'' I return to A and not to B' as expected. Doesn't android store instances of an activity in the back stack or do I have to do something to tell android to save every single instance so I can navigate between them?

Upvotes: 4

Views: 1377

Answers (1)

Sebastian Breit
Sebastian Breit

Reputation: 6159

You should read Google's Tasks and Back Stack document.

Upvotes: 1

Related Questions