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

来源:互联网 发布:怎么找网络水军 编辑:程序博客网 时间:2024/05/01 18:09
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(2131296326, class com.kyutils.view.RTPullListView) with Adapter(class android.widget.HeaderViewListAdapter)]


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.
with Adapter




解决办法:
//lv_listview.setAdapter(mAdapter);不要在主线程中这样改为下面方法
Message mess = mHandler.obtainMessage();
mess.what = 0;
mHandler.sendMessage(mess);
case 0:
lv_listview.setAdapter(mAdapter);
//mAdapter.refreshData(mDatas);
break;


///
runOnUiThread(new Runnable() {
public void run() {
    adapter...
}
});
0 0
原创粉丝点击