开发者

Is there any way to stop recycling listview views in android when they r not visible on screen

Actually i am using baseadapter for constructing listview , in each view i hv checkbox and i need to know there states ie ischecked() for my application requirement ,

i开发者_开发知识库f i am using listview.getchild() i am getting total no of views in my listview but when i am trying to iterate i can iterate through only visible items on the screen and other indexes are giving null.

so is there any chance of stopping recycling the listview.

Please help me ...

or any alternate solution for my problem.


yourList.getCheckedItemPositions()?

You should use as few objects as possible. That is why invisible items are recycled. And you shouldn't try to change this approach


No you can't do this. ListView holds only views it shows atm. You can cache all list items in you adapter but it's a really bad idea. Just hold checkbox states in some container like array or map.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜