android - 安卓Listview中如何获取所有item对象?
ringa_lee
ringa_lee 2017-04-17 17:00:33
0
3
607
ringa_lee
ringa_lee

ringa_lee

reply all(3)
阿神

The dynamically modified object should first be the data entity object, and then the bound View object. After the data is changed, can't the convertView be modified by calling the adapter's notifyDatasetChanged()? It is not recommended to cache the convertView object to the list. The view object consumes a lot of memory. I am afraid that you will not be able to release it in time, which will cause unnecessary trouble.

洪涛

ListView is only responsible for display and should modify the data source. You regard data sources, Adapters, and ListViews as manifestations of the MVC pattern. You will know what to do when you encounter such doubts in the future.

刘奇

Before returning convertView in getView, you just need to add it to a List (the convertView at this position was not added to the List before). Make sure that the convertView at each position is added to the List and only was added once.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template