Can anyone tell me how to make an EditText
not editable via XML? I tried setting android:editable
to false
, but
- it is deprecated; and
- it didn't work.
Can anyone tell me how to make an EditText
not editable via XML? I tried setting android:editable
to false
, but
Add this to your EditText xml file:
It will do the same effect as
android:editable="false"
. Worked for me, hope it'll work for you too.and use following :
As you mentioned android:editable is deprecated. android:inputType="none" should be used instead but it does not work due to a bug (https://code.google.com/p/android/issues/detail?id=2854)
But you can achieve the same thing by using focusable.
Via XML:
From code:
if you want to click it, but not want to edit it, try:
android:editable is deprecated so use inputType instead.
Try this code. It's working in my project, so it will work in your project.