Amir
Amir

Reputation: 335

Android Studio EditText default String

Whenever I want to write a String in EditText field, the default message ,for example "enter message" in this case, does not get deleted and I have to delete it manually to see my string only. Right now, if I type a new string, it appends to the enter message string in EditText.

Is there any way the default string in EditText to be deleted as soon as I type a string?

Typing a new string adds the string to the beginning of the default message

Upvotes: 0

Views: 67

Answers (1)

Tanurwijaya
Tanurwijaya

Reputation: 36

Don't use 'text'. Use

<EditText
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:hint="Enter a message"
    />

Upvotes: 1

Related Questions