On Thu, Jun 17, 2010 at 11:43 PM, Nathan <[email protected]> wrote:
> Are anonymous inner classes okay?

Yes, so long as they are only referenced by the Activity (or things
related to the Activity).

Having an anonymous inner class used for a click listener, for
example, is OK, because the widget is part of the activity, so the
whole thing will get garbage-collected as a whole.

> I also see something like this in the samples:
>
>    private OnClickListener mStopRepeatingListener = new
> OnClickListener() { . . .
>
> Are member variables points to a non static anonymous inner class
> okay?

Yes, same as above.

-- 
Mark Murphy
CommonsWare
[email protected]
http://commonsware.com

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