简体   繁体   English

如何在Group of Expandable Listview的单击上动态添加和设置ArrayList的子数据?

[英]How to dynamically add and set child data from ArrayList on click of Group of Expandable Listview?

I am having arraylist which is having data from WebService. 我有arraylist,其中有来自WebService的数据。 Now I want to add this data on particular group click of Expandable listview. 现在,我想将此数据添加到可展开列表视图的特定组单击上。

Once data is changed you can call notifyDataSetChanged() to the adapter. 更改数据后,可以调用适配器的notifyDataSetChanged() But, while data is been added to the list , if you are using expandableList, you will face a runtime exception saying, adapter data is changed and it's not notified. 但是,在将数据添加到列表中的同时,如果您正在使用expandableList,则将遇到运行时异常消息,说明适配器数据已更改且未通知。 So, add all the data togerther to adpater and call notifyDataSetChanged() to the adapter. 因此,将所有数据一起添加到adpater中,然后向适配器调用notifyDataSetChanged()

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在Expandable ListView中为子项为零的组设置无指示符? - How to set no indicator for the group having zero child in Expandable ListView? 如何动态地将子项添加到可展开的列表视图中。 - How do I add child items dynamically to an expandable listview.? 如何从列表视图按钮单击添加多个数据到arraylist? - How to add multiple data to arraylist from listview button click? 如何将数据添加到具有多个视图的子项的可扩展列表视图 - How to add data to the Expandable listview with child having multiple views 如何动态地将数据从url填充到android中的可扩展listview类别? - How to dynamically populate data from url to expandable listview categories in android? 如何在android中的expandable listview中设置子项限制 - How to set a limit for the child in expandable listview in android 如何为自定义可展开列表视图子项设置选择器 - How to set selector for custom expandable listview child 如何在展开式列表视图中添加子项? 安卓系统 - How to add Child Item in an expandable listview? Android 如何在Android的Expandable ListView的子项中添加imagebutton? - How to Add imagebutton to child of Expandable ListView on Android? 可扩展的Listview子计数动态 - Expandable Listview Child count Dynamically
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM