Is there a way to use a placeholder in EditText?

Asked 2 years ago, Updated 2 years ago, 65 views

I want to put a placeholder text in EditText, but isn't it in xml?

final EditText name = new EditText(this); Do I have to do it on the code? What should I do next?

android placeholder

2022-09-22 22:17

1 Answers

As a code, you can put a predefined string id in string.xml in setHint(int). In xml, android:hint="What you want to say" can be used like this.


2022-09-22 22:17

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.