Make EditText ReadOnly

warna picture warna · Jun 17, 2011 · Viewed 178.2k times · Source

I want to make a read-only EditText view. The XML to do this code seems to be android:editable="false", but I want to do this in code.

How can I do this?

Answer

Nikhil picture Nikhil · Jun 17, 2011

Please use this code..

Edittext.setEnabled(false);