11-21 02:19:01.997: ERROR/AndroidRuntime(733):
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(2131361816, class android.widget.ListView) with Adapter(class android.widget.HeaderViewListAdapter)]
11-21 02:19:01.997: ERROR/AndroidRuntime(733):
at android.widget.ListView.layoutChildren(ListView.java:1492)
但是我在加载成功的时候,已经写了exadapter.notifyDataSetChanged(),偶尔会报这种错误!
------最佳解决方案--------------------
线程1更新了Adapter中的内容,却还没有来得及通知内容已经更新,就又有线程2更新了Adapter中的内容,这个时候如果线程1再通知内容更新,就会出现上述异常了
------其他解决方案--------------------
不要在新开线程调用adapter,要在UI线程调用
------其他解决方案--------------------
确保更新操作是在主线程里面执行,而需要更新的数据加载可以在子线程里面
------其他解决方案--------------------
我只有一个线程啊!