protected void onPause () {
TextView textView = ...; // fetch it as appropriate
textView.setError(null);
}
Because as mentioned in the documentation:
If the error is null, the error message and icon will be cleared.
editText.error = null
To make it more readable, you could add this extension function
fun EditText.clearError() {
error = null
}
editText.setError(null);
You can also do it using following :
protected void onPause () {
mEditText.setError(null);//removes error
mEditText.clearFocus(); //clear focus from edittext
}
just put .setError(null)
at the end of the EditText.
mEditText.setError(null);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With