It will only destroy activities if you have a large number of them on your
stack.  In practice, I think most apps will hit an out of memory error on
their local heap before encountering this (and don't have significantly deep
stacks), so are unlikely to encounter it.

On Sun, Jul 10, 2011 at 8:17 AM, nadam <a...@anyro.se> wrote:

> In a low memory situation Android can shut down apps and has some
> logic to prioritize which apps to shut down first. I have read some
> comments that Android can also partially destroy an app by destroying
> Activities that are not currently used. Since I haven't found any
> documentation about this, I suspect that this could be a
> misunderstanding and that what they are experiencing is in fact that
> the whole app has been destroyed and then the app has been started
> again by the user.
>
> Example:
> 1. The app starts and creates ActivityA
> 2. ActivityA starts ActivityB
> 3. ActivityB starts another app, for instance Google Maps
> 4. Android destroys only ActivityA due to low memory
>
> But what actually happened:
> 4. Android destroys the whole app due to low memory
> 5. The user presses the back-button
> 6. The app starts again and creates ActivityB
> 7. Developer thinks (based on stack-traces) that the app has been
> running all the time but only ActivityA was destroyed
>
> If Android can in fact destroy just a single Activity, how is the
> decision made between destroying unused Activities in the least 5
> prioritized apps vs. completely destroying the least 2 prioritized
> apps?
>
> Or is the partial destroying just a myth (like the destroying statics
> myth)?
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
>



-- 
Dianne Hackborn
Android framework engineer
hack...@android.com

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to