When should we use android:clickable in XML? Should we ever?
Is there any difference between such XML declaration and in-code declaration myButton.setOnClickListener? I have read the documentation, but I could not find out when and why should I ever use this attribute.
PS. I was implementing an ad SDK and found that their developers were using android:clickable with WebView and I was intrigued why did they use it.
As the documentation states, and as far as I know :
So for example if you just declare a
WebvieworViewin yourlayout.xmland try to set anOnClickListeneron this views theOnClickevent won’t be fired unless you specify the attribute :