处理The content of the adapter has changed but ListView did not receive a notification异常
来源:互联网 发布:手机主题公园软件 编辑:程序博客网 时间:2024/05/17 02:26
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了,注意千万不要在后台去修改类变量的方式去修改数据;
- 处理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.
- 缓存
- magento缓存系列详解:clean cache
- oracle及操作系统对于文件大小的限制
- SQL Server常用命令
- smarty变量调节器,缓存
- 处理The content of the adapter has changed but ListView did not receive a notification异常
- java的内存泄露(转自:http://blog.csdn.net/elimago/archive/2007/12/18/1946380.aspx)
- C++编程对缓冲区的理解
- magento缓存系列详解:如何缓存一个block
- html 缓存控制
- 【Cocos2d-X(1.x 2.x) 】iOS6与iphone5适相关设置随笔(解决第三方类库无法通过armv7s编译的方法、添加Default-568h@2x.png)
- 页面跳转的几种方式
- spring MVC 注解
- VMware中bridged、NAT和host-only .