Pre-Honeycomb (Android 3), each Activity was registered to handle button clicks via the onClick tag in a Layout\'s XML:
onClick
android:onClick=\"m
As I see answers they're somehow old. Recently Google introduce DataBinding which is much easier to handle onClick or assigning in your xml.
Here is good example which you can see how to handle this :
There is also very nice tutorial about DataBinding you can find it Here.