The content of the adapter has changed but ListView did not receive a notification

来源:互联网 发布:网络调试面试题 编辑:程序博客网 时间:2024/06/06 23:16
在Android编程中使用Adapter时,偶尔会出现如下错误: 

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。

看了网上好几个帖子 

http://bbs.csdn.net/topics/390286824

http://www.eoeandroid.com/thread-79950-1-1.html

http://blog.csdn.net/garybook/article/details/7498342

http://gundumw100.iteye.com/blog/1738829

最直接有效的就是  从线程新获得的新数据先传到主线程,不要直接在子线程中为其赋值.

0 0
原创粉丝点击