Can anyone tell me how to make an EditText
not editable via XML? I tried setting android:editable
to false
, but
I use EditText.setFocusable(false)
and set true again if I want to edit.
disable from XML (one line):
android:focusable="false"
re-enable from Java, if need be (also one line):
editText.setFocusableInTouchMode(true);
This combination worked for me:
<EditText ... >
android:longClickable="false"
android:cursorVisible="false"
android:focusableInTouchMode="false"
</EditText>