> > I think the idea is that if you've just placed something in a (shared)
> > HashMap with the value being a WeakReference to the object of
> > interest, then immediately launch an activity to grab that value by
> > id, the value you placed in the map will almost 100% be guaranteed be
> > available by the time the activity's onCreate is called, but not
> > permanently occupying space on the heap.  Sure, it's not 100% safe to
> > assume it exists, but a likely bet if the gc uses any kind of LRU
> > mechanism to clean up a weakly referenced object.
>
> Yeah, that's the kind of code I like -- it'll "probably" work "most of
> the time".

There are cases when it's agreeable to make a small sacrifice in
reliability for great increases in speed and convenience.  And you may
have heard of such a thing as a "failover strategy".

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

Reply via email to