Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

android listview empty message with header

Is there any way to display the empty message and the listview header at the same time? It seems that when i set the empty view and the list is empty, the header will not be displayed.

thx Ben

like image 827
Ben Avatar asked Jul 20 '10 14:07

Ben


1 Answers

Ugh, yeah, this is the wrong behavior in my opinion. But for better or worse, that's the way Android works.

I would advise creating a custom view and putting it in the table's footer instead. Keep a reference to the view in your activity, and set it's visibility to View.VISIBLE or View.GONE depending on what the list adapter returns in is isEmpty().

like image 68
Nik Reiman Avatar answered Sep 24 '22 11:09

Nik Reiman