How to display a special message if the filtered list view no longer contains results?

Is there a way to show a message like "No results" when I filter the list?

+1
source share
1 answer

Easy. Next to the list view, add this text view:

<TextView android:id="@id/android:empty"
               android:layout_width="match_parent"
               android:layout_height="match_parent"
               android:text="@string/empty_list_message"/>

The identifier is important; ListActivity will search for it.

Emmanuel

+2
source

All Articles