On Sun, Aug 8, 2010 at 7:27 AM, FrinkTheBrave <[email protected]> wrote: > If I had several (say 10) buttons on a form, each launching a > different subscreen, would I have to find and repeat the > setOnClickListener statement for each button, then put a switch > statement in the onClick subroutine, or is there a better way to do > it?
Use 10 separate listener instances. Or, if you are supporting only Android 1.6+, you can use the android:onClick attribute in the <Button> element in your layout XML to point to a method specifically for clicks on that individual button. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://github.com/commonsguy http://commonsware.com/blog | http://twitter.com/commonsguy _The Busy Coder's Guide to *Advanced* Android Development_ Version 1.9 Available! -- 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

