我正在创建应用程序使用ExpandableListView,我引用了一些教程.TheStableIds()设置为false?将hasStableIds()设为false的确切需要是什么?
解决方法
hasStableIds()
的文件
@H_404_7@Indicates whether the child and group IDs are stable across changes to the underlying data. @H_404_7@Returns@H_404_7@当您更改适配器的数据时,每次更改数据时,ExpandableListView应更新其视图以反映更改. @H_404_7@如果为true,则如果ID相同,则ExpandableListView可以重用相同的View. @H_404_7@如果是false,它应该重新创建所有的视图,因为它不能知道什么变化. @H_404_7@我引用的ID是由
whether or not the same ID always refers to the same object
getGroupId
和getItemId返回的ID.
@H_404_7@你也应该重写这个方法!
@H_404_7@一些问题:
@H_404_7@> BaseAdapter: set hasStableIds() to false?> Android – what is the meaning of StableIDs?