On 2/23/2012 11:55 AM, Kookamonga wrote:
Mark has way more experience than me, so I'll let him give the
definitive answer... But my two cents are that it depends on the
situation. :-)
I don't think there is a definitive answer here, only reasonable ones.
For example, if the widget for which you are writing the listener will
only appear in this Activity, then having the Activity itself
implement the interface is probably fine. But, say for example you're
creating some layout that appears on all of your activities (maybe a
common group of buttons or something like that), then I would create a
separate reusable listener class that saves you from having to
duplicate code.
Good point. I don't have a particular problem starting out with the anonymous class early in the project. When it's needed elsewhere It's a straight forward refactoring to extract the class. I'm pretty new to Android, at first glance, I'm not sure how useful this would be in the button group. Wouldn't each button need its own listener? Wouldn't there be an activity associated with them?

On Feb 23, 11:35 am, rhaazy<[email protected]>  wrote:
I think I over estimated my ability to jump right into this without
learning a bit more about the java language.
Thanks again!
http://javaranch.com is a pretty good resource for getting up to speed in the language.


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