In my application in android are many EditText fields. And I ran into a problem with hint. It is not disappearing when EditText is focused, but it disappears when I start to
This is my solution:
final EditText editText = (EditText) findViewById(R.id.activity_edittext);
editText.setOnFocusChangeListener(new View.OnFocusChangeListener() {
@Override
public void onFocusChange(View v, boolean hasFocus) {
if (hasFocus) {
editText .setHint("my little hint");
} else {
editText .setHint("");
}
}
});