From that I\'ve read you can assign a onClick handler to a button in two ways.
onClick
Using the android:onClick XML attribute where you just use t
android:onClick
Suppose, You want to add click event like this main.xml
main.xml
In java file, you have to write a method like this method.
public void register(View view) { }