Have an onClick of a deactivated item

1

I have a textview off.

campoTv.setEnabled(false);

and I am looking to send a message (toast or similar) with a message saying that it is disabled ... when you click on it. But when I use setEnabled(false) I can not access my setOnItemClickListener

How can I achieve it?

EDIT: I just tried with a setOnTouchListener without success, does not enter it if I use setEnabled(false)

    
asked by Maguz 06.03.2017 в 20:25
source

2 answers

2

Change the style, when you deactivate it, instead of calling the setEnabled, change the style of the button so that it is deactivated, and in the onclick check if it is activated or not

    
answered by 06.03.2017 в 20:53
2

If you disable a view by the method or property:

setEnabled(false)

There is no way to set up a listener.

    
answered by 06.03.2017 в 21:23