When I\'m using edittext.setError(\"enter a comment\") in android, it works fine until the keyboard suggestions come up and the error gets pushed above the
setError
Sets the right-hand compound drawable of the TextView to the "error" icon and sets an error message that will be displayed in a popup when the TextView has focus. The icon and error message will be reset to null when any key events cause changes to the TextView's text. If the error is null, the error message and icon will be cleared.
So when the text is changed it should be gone. I don't know why this doesn't happen in your case.
It should also be cleared when error message is null, so one trick could be:
edittext = (EditText)findViewById(R.id.foo); // add below this line
edittext.addTextChangedListener(new TextWatcher() {
public void afterTextChanged(Editable s) {}
public void beforeTextChanged(CharSequence s, int start, int count, int after){}
public void onTextChanged(CharSequence s, int start, int before, int count){
if(s != null && s.length() > 0 && edittext.getErrorMessage() != null) {
edittext.setErrorMessage(null);
}
}
});