Android Studio: EditText editable deprecated How to use inputType

I want to realize

android:editable="false" 

But he told me that the editable is out of date, you can use inputType .

Therefore, I do not know how to implement this using inputType .

+8
android android-studio android-widget
source share
2 answers

All of the answers above suggesting XML markup changes do not seem to work. However, I managed to achieve a similar result using the code.

Just use:

editText.setKeyListener (zero);

+1
source share

If you use any type of input that is not a type of text or number, such as date, date and time, you can use android:inputType="date" or android:inputType="datetime" or android:inputType="time" . If you are not using this type of input, you can use android:inputType="none" .

0
source share

All Articles