在 Android 上从适配器内刷新 ExpandableListView
我在如何从其子视图之一刷新 ExpandableListView
时遇到了麻烦。
listView 包含文件列表,我想提供删除这些文件的可能性。但是执行删除后,需要刷新ExpandableListView
。 我实现了自己的适配器,它扩展了BaseExpandableListAdapter
。似乎无法从覆盖的 getChildView() 方法中获取我的父对象来发送 notifyDataSetChanged() 。 :-s
我考虑过向我的活动发送一个意图,其中包含有关组状态(折叠/展开)的信息并在接收时刷新,但即使如此,我也需要 ExpandableListView
对象。
这怎么能做到呢?
提前致谢!
祝你一切顺利
S。
I'm having trouble on how to refresh an ExpandableListView
from within one of its childViews.
The listView contains a list of files, and I want to offer a possibility to delete those files. But after a deletion is performed, the ExpandableListView
needs to be refreshed.
I implemented my own adapter which extends the BaseExpandableListAdapter
. It seems there is no way to get my parent object from within the overwritten getChildView()
method to send a notifyDataSetChanged()
. :-s
I thought about sending an intent to my activity which contains information on the state of the groups (collapsed/expanded) and to refresh on receive, but even for this I would need the ExpandableListView
object.
How can this be done?
Thanks in advance!
Be well
S.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您必须
,然后ListView将重新加载数据。
You have to
Then the ListView will reload the data.