0

I have here two EditTexts' (username and password) and I want it to look like this on the start of the application:

enter image description here

But after the user should click the EditTexts' i want it to automatically delete the "username"(and "password"), like this:

enter image description here

how should i do that trick? can anyone help me, please? :)

4 Answers 4

2

Use the property android:hint

<EditText android:hint="Username"> </EditText> 
Sign up to request clarification or add additional context in comments.

Comments

0

There is something easier: use the hint-property, it does exactly what you want. It's only shown when the EditText ist empty.

Comments

0

Use the android:hint tag in the xml

E.g.,

 <EditText android:layout_width="fill_parent" android:layout_height="wrap_content" android:hint="username" /> 

Comments

0

Use the android:hint="UserName" in the xml file.

<EditText android:id="@+id/username" android:layout_height="wrap_content" android:hint="Enter Text to Send" android:inputType="text" android:text="" /> 

and also use android:password="true" in the password EditText

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.