Suppose you define android:onClick=\"doClick\"
in your Activity
as
protected void doClick(View view) { }
The document
I debugged the particular implementations. The relevant portion of the code is within the Support Library using Class.getMethod()
.
As stated in the documentation, this method only finds public member methods and behaves correctly. For some reason, all modifiers of declared protected methods of the Activity
(these are onCreate()
and doClick()
) are set to 1
, which means these are actually public.
I could only observe this behavior creating the debug
build with a Mac. So why this happens is still an open question, which I'm trying to find an answer to.