TextView to display tooltip before entering text

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.

+3
source share
2 answers

Paste android:hint="hint text"in the EditTextxml tag .

+8
source

How randomly or programmatically can you use ...

setHint(CharSequence hint)or setHint(int resId).

The equivalent of the resource identifier in xml will be android:hint="@string/hint_text"(for example).

+4
source

All Articles