Android:editable is deprecated:use a <EditText> to make it editable
Android:editable is Deprecated:use InputType instead
Analysis: About the read-only problem with the EditText control, that is, you cannot change the contents of it through the UI, but you can select part of the content to replicate. In the early SDK, the EditText has editable attributes, and now this property has been deprecated.
Workaround:
In fact, only one line of code can handle et.setkeylistener (NULL);
Note that this is not setonkeylistener, but Setkeylistener. This method is a member of the TextView, the effect of which is fully expected and the input method is not ejected when the focus is obtained.
The following is an explanation of the official document
The
Sets the key listener to is used with this TextView. This can is null to disallow user input. Note, this is has significant and subtle interactions with soft keyboards and other input method:see. getContentType () for important details. Calling this method would replace the current content type of the text view with the content type returned by the key Liste Ner.
&NBSP
is warned that if you are want a TextView with a key listener or movement method is not focusable, or if yo U want a TextView without a key listener or movement method to is focusable, you must call Setfocusable again after Callin G this to get the focusability back the way for you want it.