I have an EditText with some dummy text in it. When the user clicks on it I want it to be selected so that when the user starts typing the dummy text gets deleted.
How can I achieve this?
You can try in your main.xml file:
main.xml
android:selectAllOnFocus="true"
Or, in Java, use
editText.setSelectAllOnFocus(true);
2.1m questions
2.1m answers
60 comments
57.0k users