Skip to content Skip to sidebar Skip to footer

Empty Text View Message When Listview Is Empty

I have a ListView with an empty list catch in the XML and it works fine. How to toggle ListView Empty Text please ? This is my XML code :

Solution 1:

You just need to make use of setEmptyView(View v):

person_ListView.setEmptyView(root.findViewById(R.id.empty));

offtopic: ListActivity is using this method also, but with android.R.id.empty.

Post a Comment for "Empty Text View Message When Listview Is Empty"