java.lang.IllegalStateException: The content of the adapter has changed but ListView did not receive

原创 2013年12月02日 11:56:22
java.lang.IllegalStateException: The content of the adapter has changed but ListView did not receive a notification

String keyStr = msg.obj.toString();
                //在改变listview的数据后一定要更新adapter,不然会报java.lang.IllegalStateException
                list_association.clear();
                lv_history.setVisibility(View.GONE);
                lv_association.setVisibility(View.VISIBLE);
                lv_searchResult.setVisibility(View.GONE);
                associateWordTask = new AssociateWordTask();
                associateWordTask.execute(keyStr);

在调用完list_association.clear();在asynctask中更新adapter,问题是如果异步任务由于网络状况没有执行onPostExecute(),会导致上面的异常。在list_association.clear()后加入adpAssociation.notifyDataSetChanged();问题就解决了,以后要注意类似的问题。
版权声明:本文为博主原创文章,未经博主允许不得转载。

异步加载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 原因 在Android...

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

今天更新ListView的数据源时发生了这个异常,错误提示说要在UI线程中更新数据源,可是我明明只是在子线程中更新了list,而在UI线程中调用的adapter.notifyDataChanged()...

【遇见Android 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异常处理

最近在做一个文件浏览器的模块,采用分步显示数据而不是等待加载完成后再一次性加载,但在编写过程中发现,在异步线程中添加Listview的Adapter的数据时,当数据未加载完成点击Listvew的Ite...

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 在Android开发过程...
  • garybook
  • garybook
  • 2012年04月25日 16:00
  • 25044

The content of the adapter has changed but ListView did not receive a notification错误分析

在Android开发过程中,使用了大量的ListView,发现这个错误偶尔会出现。特别是做压力测试的时候,不停的点击刷新,更容易出现这个错误。代码中已经使用了Adapter的notifyDataSet...

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 在Android开发过程...

解决问题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. Ma...

Android - Bug: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.本文地址:http://b...

java.lang.IllegalStateException: The content of the adapter has changed but ListView did not receive

不擅长写博客,大家就可下面的连接吧 1、http://blog.csdn.net/changemyself/article/details/8116670 2、这种方法的实质和第一种是一样的htt...
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:java.lang.IllegalStateException: The content of the adapter has changed but ListView did not receive
举报原因:
原因补充:

(最多只允许输入30个字)