Hiding items in listview properly
android, android-listview, hide
Solution
I have achieved this as Tonithy suggests here. Added an if clause at the begining of getView method in adapter, which checks if item matches condition to hide. If it does getView returns "null layout".
When I want to hide an item, I set a condition and call .invalidateViews() on my listview.
Problem
I would like to show/hide items in my listview. Currently I am doing this by iterating through adapter's data. If item at certain index matches some condition, this line is called: ``` listView.getChildAt(index).setVisibility(View.GONE); ``` Item is not visible, but blank space remains (surprisingly View.GONE and View.INVISIBLE acts the same in this case). I would like to achieve the same effect as if item was deleted from adapter and `notifyDataSetChanged()` was called, but I don't want to modify underlying data, just hide the item.