I have a login
If user don't enter username or password and press "login" button, the EditText hint will warn you, like thislogin(turn red). How can I implement this?
I think you should set error instead
editText.setError(getString(R.string.error_required));
but if you want that
editText.setHint()
editText.setHintTextColor
Based on the image you have posted , it is very simple to show that hint when there is no data entered in username/password fields.
if(username.isEmpty())
{
usernameEditTextView.setHint("please enter username");
usernameEditTextView.setHintTextColor(R.color.Red);
}