保持组展开状态时的变化数据可扩展列表视图 [英] Keep Group Expanded Status when change data expandable list view
问题描述
当用户单击该组行,孩子们列表展开并显示。当我添加任何团体项目ArrayList和调用方法 notifyDataSetChanged();
集团扩展状态不对..怎么办修复
When user click the group row, the children list is expanded and show. When i add any group item to Arraylist and call method notifyDataSetChanged(); Group Expanded Status wrong .. how to do fix
例如:
;当我集团母公司0添加到第一和调用的 notifyDataSetChanged()当前位置组1(父母2)扩大...。家长2是崩溃和家长1膨胀。如何保持父2 expaded
Example: Current group position 1 (parent 2) is expanded.. When i add group parent 0 to first and call notifyDataSetChanged(); . parent 2 is collapse and parent 1 is expanded. How to keep parent 2 expaded
对不起我的英语不好。
推荐答案
当你想之前加上父母和孩子,
when you want add parent and of its children just before,
1.just采取所有当前的父母和他们的孩子在一个临时名单
1.just take all current parents and their children in one temporarily list
2.清除当前充满名单。
2.clear current filled list.
3.添加新的父母和他们的孩子列表(即我们清除)。
3.add new parent and their children to list(that we clear).
4.now,加暂时列出我们目前的名单(其中我们添加新的父母和他们的孩子)
4.now, add temporarily list to our current list(in which we add, new parent and their children)
5.now使用新的填充列表您扩展列表适配器
5.now use new filled list to you expandable list adapter
6.clear您的临时名单。
6.clear your temporarily list.
这篇关于保持组展开状态时的变化数据可扩展列表视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!