Monday, July 11, 2011

[android-developers] Re: use singleton to store data

Yes, it's fine to use them.
It depends on your singleton's functionality as well. 

Note that your app's process can be killed and restarted, and you shouldn't rely on any particular Activity in your app to be started up first in order for your singleton to be (re)loaded correctly. Usually, lazily-load your singleton and don't have the data it loads be dependent on any particular Activity (dependency on a Context, application-context, would be fine though).

--
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+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

No comments:

Post a Comment