On Sun, Sep 12, 2010 at 2:26 PM, Eric Mill <[email protected]> wrote:
> Why wouldn't that work if it's a non-static inner class? Dave's
> solution is basically what I do, with the AsyncTask being a private
> (non-static) inner class of the Activity that uses it.  Store it
> across screen flips, and then if it's present in onCreate, feed it the
> new context.

Oh, technically, it'll work, but the inner class will then *also* hold
an *implicit* reference to the old activity, which you don't want, as
you'll leak memory. Since you're not using the implicit reference --
replacing it with the explicit one -- you want to use a static inner
class.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

Android Training...At Your Office: http://commonsware.com/training

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