views:

50

answers:

1

Hello.

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?

Thanks.

+3  A: 

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.

kgiannakakis