处理The content of the adapter has changed but ListView did not receive a notification异常
来源:互联网 发布:js中冒号的作用 编辑:程序博客网 时间:2024/06/05 09:04
ListView在更新时报异常:
ERROR/AndroidRuntime(15260): java.lang.IllegalStateException: 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. [in ListView(2131099657, class android.widget.ListView) with Adapter(class com.pocketdigi.pptheater.ListAdapter)]
网上有很多蛋疼或者治标不治本的解决方法,其实解决方法很简单:
1.如何你使用线程处理的后台数据,那么就在run方法里面用Handler将数据send出来到主线程里面的handleMessage然后再addAll或者赋值;
2.如果用的异步task,那么在onPostExecute里面去add或者赋值就ok了,注意千万不要在后台去修改类变量的方式去修改数据;
在线程里面不要持有数据的引用,而是直接搞局部变量然后send出去,再添加到类变量上面,绝对没有问题的。
from:http://blog.csdn.net/androidzhaoxiaogang/article/details/8183529
0 0
- 处理The content of the adapter has changed but ListView did not receive a notification异常
- 处理The content of the adapter has changed but ListView did not receive a notification异常
- 处理The content of the adapter has changed but ListView did not receive a notification异常
- 处理The content of the adapter has changed but ListView did not receive a notification异常
- 处理The content of the adapter has changed but ListView did not receive a notification异常
- The content of the adapter has changed but ListView did not receive a notification异常处理
- 处理The content of the adapter has changed but ListView did not receive a notification异常
- ListView异常:The content of the adapter has changed but ListView did not receive a notification
- The content of the adapter has changed but ListView did not receive a notification 异常解析
- The content of the adapter has changed but ListView did not receive a notification 异常解决
- The content of the adapter has changed but ListView did not receive a notification 异常解决方案
- listview提示The content of the adapter has changed but ListView did not receive a notification
- ListView The content of the adapter has changed but ListView did not receive a notification.
- The content of the adapter has changed but ListView did not receive a notification.
- The content of the adapter has changed but ListView did not receive a notification
- 解决bug:The content of the adapter has changed but ListView did not receive a notification
- The content of the adapter has changed but ListView did not receive a notification
- The content of the adapter has changed but ListView did not receive a notification.
- java.util.ServiceLoader使用
- Android PagerSlidingTabStrip 开源项目
- 重装mysql
- CDC中的SelectObject
- 关于招人
- 处理The content of the adapter has changed but ListView did not receive a notification异常
- java中list,map使用泛型和不使用的区别
- linux的配置接口-netlink原理和设计
- oracle远程登录解决方法
- Worklight+eclipse+sencha-touch
- Office365教程之跟着五毛哥从零开始学习
- 安卓第一个项目HelloWord!
- First/Follow集合的求法
- 学习笔记-轻量级Java EE:JSP基本知识