Issue
I want to add a clear function to a button. I have written this code:
clear.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
name.setHint("Enter name");
mail.setHint("Enter mail");
num.setHint("Enter num");
}
});
It works when the field is empty but does not if the field has content in it.
Thank you for your time. It's not a TextInputLayout. Works well with EditText.setText .
Solution
The hint will only show when the content is empty. So you may clear your content and set hint at the same time.
Answered By - ruby6221
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.