您的位置:首页 > 其它

解决问题The content of the adapter has changed but ListView did not receive a notification.

2017-02-16 12:35 615 查看
出现的问题:

The content of the adapter has changed but ListView did not receive a notification. Make sure the content of your adapter is not modified from a background thread, but only from the UI thread. Make sure your adapter calls notifyDataSetChanged() when its content changes.

问题重现

情况是这样的:首先:ListView1嵌套ListView2,ListView1传入Adapter的数据里有一个List1,因为数据格式不是我想要的,所以我又在Adapter里new List2,把List1放入一个List2里面,之后把这个新生成的集合设置给ListView2,因为是ListView嵌套ListView,所以我在重新放数据的时候要把每个条目的List清空,所以就出现了这个问题。

解决问题

出现这问题是因为你的数据源变了报这个异常

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: