Can anyone tell me how to make an EditText
not editable via XML? I tried setting android:editable
to false
, but
Use this simple code:
textView.setKeyListener(null);
It works.
Edit : To add KeyListener
later, do following
1 : set key listener to tag of textView
textView.setTag(textView.getKeyListener());
textView.setKeyListener(null);
2 : get key listener from tag and set it back to textView
textView.setKeyListener((KeyListener) textView.getTag());