How to put text in an empty TextView so that it disappears when the user starts typing? Same as here in StackOverflow in the Tags field.
The same approach is used in the GMail client. It will save me in space - no need to create shortcuts.
Paste android:hint="hint text"in the EditTextxml tag .
android:hint="hint text"
EditText
How randomly or programmatically can you use ...
setHint(CharSequence hint)or setHint(int resId).
setHint(CharSequence hint)
setHint(int resId)
The equivalent of the resource identifier in xml will be android:hint="@string/hint_text"(for example).
android:hint="@string/hint_text"