如何在Android应用程序禁用的EditText捕捉onclick事件

问题描述:

我有一个EditText上,我是presenting为禁用,这样用户无法编辑的内容,也避免了弹出式键盘。但现在我想捕捉中的EditText onclick事件并确定被点击的各个单词。 任何帮助是值得欢迎的。

I have a EditText which I am presenting as disabled so that user cannot edit the contents and also to avoid popping-up keyboard. But now I want to capture onclick event in the EditText and identify the individual words that are being clicked. Any help is most welcome.

谢谢, Balkrishna。

Thanks, Balkrishna.

设置机器人:可调焦=假的EditText 安卓启用=真正的。 并集 OnClickListener 的EditText 。上EDITTEXT的点击触发的onClick()方法,但它不能编辑。我刚才试了一下。

Set android:focusable="false" on your EditText and android:enabled="true". And set OnClickListener to that EditText. The click on that Edittext triggers the onClick() method but it can't be edited. I just tried it.