http://developer.android.com/reference/android/view/View.html#attr_android:onClick
Here it is said that
For instance, if you specify android:onClick=”sayHello”, you must declare a public void sayHello(View v) method of your context (typically, your Activity).
I’m intrested in “typically, your Activity”… And what if not typically? I’m creating a widget app so I don’t have an activity at all…
Almost forgot..
And the question is: where should I write that sayHello method?
Here’s the code which is responsible for the invacation:
So basiclly it searches in the class which implements the context for the given method. Usually the context is an activity.