From that I\'ve read you can assign a onClick
handler to a button in two ways.
Using the android:onClick
XML attribute where you just use t
Note that if you want to use the onClick XML feature, the corresponding method should have one parameter, whose type should match the XML object.
For example, a button will be linked to your method through its name string : android:onClick="MyFancyMethod"
but the method declaration should show:
...MyFancyMethod(View v) {...
If you are trying to add this feature to a menu item, it will have the exact same syntax in the XML file but your method will be declared as: ...MyFancyMethod(MenuItem mi) {...