empty ListView, how can I show a message on a ListView when it's empty?
I'm developing an Android application.
Is there any way to show a message on a ListView only with it's empty?
I'm using a custom ArrayAdapter, so I have to create a specific object with the text I want to show.
I'm wondering if there is a specific field on ListView to setup a message when it's empty.
Any advice?
Than开发者_JS百科ks.
See the documentation of ListActivity:
Optionally, your custom view can contain another view object of any type to display when the list view is empty. This "empty list" notifier must have an id "android:empty". Note that when an empty view is present, the list view will be hidden when there is no data to display.
精彩评论