How to disable edittext in android
Approach 1:
In code:
editText.setEnabled(false);
Or, in XML:android:editable="false"
Approach 2:
edittext.setFocusable(false);
edittext.setEnabled(false);
InputMethodManager imm = (InputMethodManager)
getSystemService(Context.INPUT_METHOD_SERVICE);
imm.hideSoftInputFromWindow(edittext.getWindowToken(), 0);
//removes on screen keyboard
Comments
Post a Comment