We can set editable property of EditText in XML layout but not programatically, but there is no setEditable() method!
EditText
setEditable()
If EditText
I did it in a easier way , setEditable and setFocusable false. but you should check this.
How to replicate android:editable="false" in code?