Android 6 EditText.setError not working correctly

六眼飞鱼酱① 提交于 2019-12-03 11:08:37

use getString(R.string.error_name)

TRY @NotEmpty annotation on Email edittext field

@NotEmpty
@Email
private EditText email;

i think this is related to activity theme, this what i'm using and working in android 6.0:

activity theme :

<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
    <!-- Customize your theme here. -->
    <item name="colorPrimary">@color/colorPrimary</item>
    <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
    <item name="colorAccent">@color/colorAccent</item>
</style>

code : please note i'm extending activity not AppCompatActivity

myeditText.setError("Please enter valid email");
myeditText.setFocusable(true);
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!