Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Enter text into an EditText which then disappears when user clicks inside it

Tags:

android

I would be very grateful if someone could explain if it is possible to enter text into an EditText. (This would be done with android:text="")

But then the text would disappear when user clicks inside it.

Thanks

like image 789
Raj Avatar asked Feb 09 '11 16:02

Raj


2 Answers

This can be done by using hint:

android:hint="the text you want"
like image 182
Jonathan Roth Avatar answered Oct 30 '22 08:10

Jonathan Roth


Use the android:hint="" attribute .. it is removed when the edittext is clicked on

EDIT: I was too late :)

like image 7
Linora Avatar answered Oct 30 '22 06:10

Linora