In my application, I have an EditText that the user only has Read access not Write access.
In code I set android:enabled="false"
.
Although the background of EditText changed to dark, when I click on it the keyboard pops up and I can change the text.
What should I set to disable EditText?
This works for me:
android:focusable="false"
Simply:
From @Asymptote's comment on the accepted answer, use:
...and Bob's your uncle.
Use this to disable user input
android:editable="false" This method is deprecated one.
Set below properties in class:
It will work smoothly as you required.
Try this one, works fine for me:
Note: You need to add
this.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);
on your activity or elsekeyboard
will popup at first time.