[英]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.