user3383415
user3383415

Reputation: 435

Edit Text´s default text

How can I set a default text in an EditText of android. But I want only an informative text not editable, and when you click in the edit text you can write all you want without having to delete this text.

I want text that is present when the EditText is still empty, but disappears as soon as the user starts to type something.

Thank you.

Upvotes: 1

Views: 73

Answers (1)

Lal
Lal

Reputation: 14810

Add the hint property for the edittext like this

android:hint="Email"

It sets a Hint text to display when the text is empty.

Upvotes: 3

Related Questions