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
Post a Comment