The EditText
field has a TextChangedListener
with setting/clearing the error in afterTextChanged()
and with setting/clearing the error in (fragments) onCreateView()
.
I'm evaluating if the field has error when the Back button is pressed and it works like a charm ;)
Problem comes when the focus is on the field with keyboard open. Then, pressing back closes the keyboard which (apparently) removes the error from the EditText
. Because of that, when error is evaluated on next back press, there is no error (and things happen which were not expected).
Is it possible that the layout change (caused by the soft keyboard) removes the error from the EditText
?
When another (text field) is focused after the keyboard was closed, the error is there.
Btw. I have tried this solution, but the onKeyPreIme is never called...