Thank you. 
Another related question, in section "5. Implement a more intelligent 
AsyncTask dealing with screen orientation" of 
http://blog.doityourselfandroid.com/2010/11/14/handling-progress-dialogs-and-screen-orientation-changes/,
 
it has private AsyncTaskComplex activity in ListFresher as a member 
variable. Shouldn't it be null out because it is not a static Activity 
references?
 

Kristopher Micinski於 2013年1月14日星期一UTC+8下午4時24分53秒寫道:

> Basically, as long as you aren't hanging static Activity references 
> you should be fine.  The main activity will be thrown away upon its 
> destruction, at which point the Activity will be thrown away: along 
> with its contents.  Of course, if you're holding onto Views elsewhere 
> that's bad (i.e., don't hold static refs). 
>
> kris 
>
> On Mon, Jan 14, 2013 at 1:42 AM, Greenhand 
> <[email protected]<javascript:>> 
> wrote: 
> > I read 
> > http://android-developers.blogspot.tw/2009/01/avoiding-memory-leaks.html 
> > about avoiding memory leaks. 
> > I would like to know whether I should null out all member variables, 
> such as 
> > TextView and Button in onDestroy()? Or, unregistering listener, 
> unbinding 
> > service and etc.in onDestroy() are enough to prevent memory leak? 
> > 
> > -- 
>
>

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