android - Why does Wrap_Content fire BindView more than once -
i working on android app listview , in process of optimizing it. uses custom cursor adapter in 1 activity , noticed bindview() firing twice each row of list. while researching bindview() , newview() methods here, read in post having wrap_content width of listview bad idea. switched fill_parent , viola bindview() , newview() each fire once each item.
so can better understand internals of andorid os, know why wrap_content caused bindview() fire multiple times.
i have done several searches on google, android developer docs , here no luck.
any response appreciated.
thanks, george
if recall correctly video google i/o, setting width (or height) of listview wrap_content cause measure first 3 items , base dimensions off of those. in order measure first 3 items, must call bindview() populate them. once has measured, populate , call bindview() again on first 3 , subsequent.
this due fact listview keeps in memory on screen when may have potentially infinite number of items in list. not designed wrap_content largest item because stuck in drawing phase forever.
Comments
Post a Comment