On Fri, Jun 1, 2012 at 5:16 PM, dev0708 <[email protected]> wrote:
> I’ve observed two ways to handle a button press: #1 and #2 below.
> - Can anyone explain the situations where I should use one or another?

You would use #2 if:

- you are deploying to Android 1.5 (or earlier), where android:onClick
did not exist, or

- you want your button clicks to be handled by something other than
the hosting activity (e.g., a fragment)

> - Are there more ways to handle a button press?

That depends on what you mean by a "button press". Those are the two
ways of handling a click event on a View.

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

Android Training in NYC: http://marakana.com/training/android/

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