Search code examples
androidandroid-edittexthint

EditText hint not showing (Java - android)


I saw lots of questions about this topic, but I've found anything that solve my problem. I saw different solutions:

  • Removing gravity
  • Removing inputType
  • Insert android:ellipsize attribute

But no one has worked. Here's a sample of my code:

<EditText
    android:id="@+id/edtNotesText"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:layout_below="@+id/layoutNotesEditMenu"
    android:gravity="left|top"
    android:hint="@string/edt_text_notes_add_hint"
    android:inputType="textFilter|textMultiLine|textNoSuggestions"
    android:padding="6dp"
    android:scrollbars="vertical"
    android:textColor="@color/lightGrey"
    android:textSize="20sp" />

Solution

  • I've find out the problem: I forgot the instruction "setContentView"! Might be trivial but maybe could help someone else.