I have this error when I try to use a button with an android:onClick from a fragment :
fragment.java : fragment.xml :
But in the design tool, it is well recognized :
I am aware that the issue is probably somewhere else in the code but I really dont know what to check ?
CodePudding user response:
With certitude, the called method by the onclick
must be on the activity.java
which launches the fragment.java
even if you are in this fragment.
But in this case in the design tool
, in the onclick
field, your method does not appear.
You need to add and define android:onClick
manually.
It remains a bit unclear but it works fine even if I probably do not use the right method.