How do I put text into开发者_JS百科 empty TextView so it goes away when user starts typing? Just like here in StackOverflow under "Tags" field.
Same approach used in GMail client. That will save me some space - no need to create labels..
Throw an android:hint="hint text"
into your EditText
xml tag.
As haphazard said or programatically you can use...
setHint(CharSequence hint)
or setHint(int resId)
.
The equivalent to the resource id in xml would be android:hint="@string/hint_text"
(for example).
精彩评论