Mark Wyszomierski wrote:
> If I follow the lifecycle docs correctly, an Activity won't get
> notified if it's force killed for memory?

Correct. In a true "force kill" scenario, Android needs RAM quickly and
cannot rely upon you to do something quickly.

> But was does onDestroy() get called, so we have a
> chance to clean up? Or do we just have to write safeguards in onCreate
> () to check for a force-kill as mentioned in this post?:
> 
> http://groups.google.com/group/android-developers/browse_thread/thread/1b342cd8f940d98c/0958bfede0b2b87a?lnk=gst&q=kill+low+memory#0958bfede0b2b87a

You should never assume that static data, like a singleton, exists,
unless it is final (i.e., never modified). onDestroy() may or may not be
called, etc.

That being said, I had kinda assumed, in the case of a force-kill of
your process for memory reclamation, your activity would also be removed
from the stack. If your scenario is indeed what's happening, that
implies that your app's activities remain on the stack despite the
force-kill, which surprises me.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://twitter.com/commonsguy

Android Development Wiki: http://wiki.andmob.org

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

Reply via email to