Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android 6 EditText.setError not working correctly

I have upgraded to android 6 and seeing some strange things when trying to set validation for some editTexts. I am using android-saripaar for validation:

@Email(messageResId = R.string.error_email)
private EditText email;
@Password(min = 6, scheme = Password.Scheme.ALPHA_NUMERIC_MIXED_CASE_SYMBOLS)
private EditText password;
@ConfirmPassword
private EditText repassword;
@NotEmpty(messageResId = R.string.error_name)
private EditText firstname;
@NotEmpty(messageResId = R.string.error_name)
private EditText lastname;
private Validator mValidator;

For some reason the email, password, confirm password are not showing the error message on the popup, while the last and first name are fine

enter image description here

I have tried without the library and the same issue occurred. Using editText.setError("Some Message") This did not happen prior to android 6 and was working fine on 5.

Anybody experienced similar to this? if so how did you fix it?

like image 359
user1601401 Avatar asked Mar 13 '16 01:03

user1601401


1 Answers

use getString(R.string.error_name)

like image 143
Ruyonga Dan Avatar answered Oct 05 '22 07:10

Ruyonga Dan