On Mar 23, 2011 9:15 AM, "Jake Colman" <[email protected]> wrote:
> If I create an instance of a singleton from within an
> activity/service/receiver, am I correct that that same instance is
> available to the other components of my application?

For the life of the process, yes.

> If so, then is it
> correct to say that all the components of my application share the same
> memory space.

For the life of the process, yes.

> If that is the case, how do I know (or should I even try to know) if my
> singleton instance has gone out of scope?  Does it get destroyed when
> the last component of my application has been killed by Android?  Is
> there a way for me to know that?  Do I care?

Do not care. Singletons are only caches, not persistent stores.

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