Android set View.GONE does not "release" space in listview

Changing the android:layout_height="wrap_content" to android:layout_height="fill_parent" fixed the issue.. was testing with a long list.. with a short list the same space was above the list.. Stupid mistake..

Thanks all for help.. everything is working now.


Are you trying to hide the whole list item? If so I guess that the list view won't like that because it is still calculating with the same amount of items. I don't think it will just ignore it because it's gone.

The clean solution would be to return another getCount and just ignore the items you want to hide. Or remove items from the internal used list. Call notifyDataSetChanged on the adapter when you modified the amount of items in the list.