Bug: Make an EditText non-editable, using inputType

Bug: How to make an EditText non-editable, using inputType

Recommend using this instead: Make an EditText non-editable

android:inputType="none" replaces the deprecated android:editable="false". However, there is a bug in android:inputType = "none" and this code does not work. (Bug: https://code.google.com/p/android/issues/detail?id=2854)

1. Create an Android project, if you don't already have one.

2. Add a EditText.

3. In the main.xml file, add the below line

  <TextView
    .... //Added in API level 3
      android:inputType = "none"  //nothing happens with this code, Android bug
  />
 
5. Compile and run! (It won't work, unless Android fixed the bug)

Related Articles
Resources: