How to display a special message if a filtered list view contains no results any more?
Is there any way to show a message such as "No results" when i filte开发者_如何学Cr a list?
Easy. Next to your 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 ID is important; the ListActivity will look for it.
Emmanuel
精彩评论