I am using TextInputLayout from com.android.support:design:23.3.0
When I first apply an error it is shown correctly.
mInputPassword.setError(getString(R.string.error_invalid_password));
mInputEmail.setError(getString(R.string.error_field_required));
On the next login attempt I clear the error.
mInputEmail.setError(null);
mInputPassword.setError(null);
Then I run the validation and set the error again using the same code as above but this time the red line is applied but the error text is missing.
Anyone have any ideas on why this might be happening or have experienced similar situations?
I saw something similar reported here but it is for an older version of the design library and don't know if it is still a issue in the verison I am using,
You simply has to do these steps:
setErrorEnabled(true);
setError("error");
for clearing:
setError(null);
setErrorEnabled(false);
repeat the first step to set a new error. setError(null)
clears the error message and icon, so I think the view to show is simply gone and setErrorEnabled(false)
will reset it.
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