解决问题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清空,所以就出现了这个问题。
解决问题
出现这问题是因为你的数据源变了报这个异常
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清空,所以就出现了这个问题。
解决问题
出现这问题是因为你的数据源变了报这个异常
相关文章推荐
- HDU3360-二分图最小点覆盖
- 异或
- Netscaler重置密码的方法
- 汇编6--灵活定义内存地址
- Centos6.8 安装tomcat8.5.11
- sublime
- IP数据报格式 及分组转发算法
- 二段构造模式 初始化对象
- Layout -CheckBox控件
- linux的vim配置
- Java中的各种区别
- 【LeetCode】461. Hamming Distance【E】【90】
- 电子战技术基础知识简介
- MyEclipse开发XML文件不提示的问题
- X-009 FriendlyARM tiny4412 uboot移植之SD Card用起来Kernel boot起来
- QT——设置可执行文件图标
- 安卓文档
- QT —— 应用程序发布
- SpringMVC之上传文件
- 摩羯座