I was trying to understand the “Using Messenger” in Bound Service example in Android Documentation. The example had a method named sayHello(View v). I could not quite understand how the method is called and why it takes a view as a argument.
I hope the question can be useful to others and community will take the question positively.
Thanks.
You could define an ‘android:onClick=”method”‘ in layout.xml
This calls the method with parameter “View” of your activity
You may check this QA, too
How exactly does the android:onClick XML attribute differ from setOnClickListener?