Testing onDestroy.

Q: does using a lot of RAM in one application always lead to onDestroy
being called on Activities in other applications?

To try and figure this out I created two separately installed
applications. The first just logs its lifecycle transitions and the
second allocates a chunk of memory each time you press a button.

What I saw was the second application eventually suffered a fatal Out
Of Memory Error force close. The onDestroy method was not called on
the first logging application and when I switched back to it onResume
was called.

My conclusion is that using a lot of memory in a single application
will lead to a fatal Out Of Memory Error without onDestroy first being
called on Activities in other applications. The documentation left me
expecting an onDestroy on the logging application since the foreground
application was trying to allocate more memory.

Does the above sound right? What’s a good way to test the onCreate/
onDestroy lifecycle methods as they relate to low memory?

-- 
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