android - Hiding items in listview properly -


i show/hide items in listview. doing iterating through adapter's data. if item @ index matches condition, line called:

listview.getchildat(index).setvisibility(view.gone); 

item not visible, blank space remains (surprisingly view.gone , view.invisible acts same in case). achieve same effect if item deleted adapter , notifydatasetchanged() called, don't want modify underlying data, hide item.

i have achieved tonithy suggests here. added if clause @ begining of getview method in adapter, checks if item matches condition hide. if getview returns "null layout".

when want hide item, set condition , call .invalidateviews() on listview.


Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -