Android: keep multiple instances of activity in the background stack

I have Activity A where I start Activity B In Activity B I want to start new instances of B (with different contents) so that I can return 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 of a navigation path:

A → B → B '-> B' '

when pressed in B '' I return to A, not B, as expected. Doesn't android store instances of activity in the background stack, or do I need to do something to tell the android to save each individual instance so that I can move between them?

+4
source share
1 answer

You should read the Tasks and Back Stack document.

+1
source

Source: https://habr.com/ru/post/1413721/


All Articles