Nothing worked for me, but:
<EditText android:id="@+id/text" android:layout_width="match_parent" android:layout_height="wrap_content" android:inputType="textMultiLine|textLongMessage" android:hint="\n"/>
Honestly, I donβt understand why .. but including "\ n", since the hint in xml did the trick!
Now you can call setHint from Java code:
searchEditText.setHint(getString(R.string.search_hint));
and remove \ n from strings.xml if you want to allow automatic text layout according to room
<string name="search_hint">keyword, location, max price (eg 1K, 1M)</string>
source share