android - Does calling invalidateViews() on Listview re-inflates the view for rows? -
i have been using using listview since long experienced of random behaviour. when call invalidateviews() on listviews, in cases re-inflates views each row , in cases doesn't. random. can tell me how works? ideally should refresh data inside views(rows) , not inflate them again.
thanks
calling invalidateviews() on listview should not re-inflates listview item views. way force listview re-inflates item views, meaning recycled views cleared, resetting listview adapter ( had dig in source code discover ).
if take @ invalidateviews() method implementation (source code in abslistview.java), see (android api 16) :
/** * causes views rebuilt , redrawn. */ public void invalidateviews() { mdatachanged = true; remembersyncstate(); requestlayout(); invalidate(); }
the method remembersyncstate() implemented in adapterview.java stores listview's position of selected item (if any), can check out.
the requestlayout() method takes care of measuring, laying out, , drawing (as far know) nothing here too.
and invalidate() used force list view draw (with new measurements, ...)
so calling invalidateviews() should not force list view re-inflate views. re-setting adapter somewhere re-inflates views ?
Comments
Post a Comment