3 Activity stack situation

46 Views Asked by At

I am workig with android.developer Activity Stack demo app.

The initial activity is called "A". From "A" you can start "B" and "C" activities. Essentially from any activity you can start the other two.

Here is the situation that puzzles me: I start "A", start "B" and then start "C". At this point "A" and "B" are stopped like they are supposed to. However when I start activity "A" (from current one i.e. "C") both "B" and "C" get destroyed. Can anyone explain why "B" and "C" get destroyed instead of being stopped ?

1

There are 1 best solutions below

0
On

Without looking at the code, it is hard to say, However this might be helpful from Android documents:

Multiple tasks can be held in the background at once. However, if the user is running many background tasks at the same time, the system might begin destroying background activities in order to recover memory, causing the activity states to be lost.

http://developer.android.com/guide/components/tasks-and-back-stack.html