In my application, I want EditTextone that does not accept any input, i.e. android:editable="false"in an XML layout or setKeyListener(null)in code.
I only want to add characters in a very controlled way, so I always add them programmatically with setText(), and I don't want any virtual keyboard to be displayed. However, I still need a visible cursor in EditTextso that the user knows where the program input will be inserted.
It was very easy to implement ( android:editable="false") prior to Android 4.0. In 4.0, the cursor has obviously been deleted. I tried android:cursorVisible="true", but it does not work.
Does anyone know how both have a visible cursor and still suppress input in Android 4.0? Very grateful for any help here.
source
share