I am writing an app which requires at a time the EditText view to be uneditable. I used editText.setEnabled(false); it is greyed out alright, but the IME still pops up, and I still could type in characters, why could this be???
Asked
Active
Viewed 3,676 times
1
-
Possible duplicate: http://stackoverflow.com/questions/660151/how-to-replicate-androideditable-false-in-code – eldarerathis Apr 06 '11 at 21:01
1 Answers
4
if (cbProhibitEditPW.isChecked()) { // disable editing password
editTextPassword.setFocusable(false);
editTextPassword.setFocusableInTouchMode(false); // user touches widget on phone with touch screen
editTextPassword.setClickable(false); // user navigates with wheel and selects widget
isProhibitEditPassword= true;
}
else { // enable editing of password
editTextPassword.setFocusable(true);
editTextPassword.setFocusableInTouchMode(true);
editTextPassword.setClickable(true);
isProhibitEditPassword= false;
}

JAL
- 3,319
- 2
- 20
- 17