> Hmmm...so, static class members are definitely always
> preserved through an orientation flip?

Unless you manually null them out or something, yes. Static data,
services, Application subclasses, and the like all are unaffected by
rotations.

> For example, I assume that doesn't necessarily apply to
> other sorts of changes, such as switching to another app.  If an app
> goes to the background long enough and the user does enough other
> things with the device, it surely must get shunted from memory if the
> OS needs the RAM back, so in such a case statics would not survive the
> app coming back to the foreground, right?

Correct. Static data, services, and Application subclasses are only good
for short-term storage. Anything that might need to survive a normal
closing of your activity should be saved either through
onSaveInstanceState() or your own files/database in a method like
onDestroy().

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com
Android App Developer Books: http://commonsware.com/books.html



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