错误信息:
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. Make sure your adapter calls notifyDataSetChanged() when its content changes. [in ListView(16908298, class com.huawei.fans.pulltorefresh.library.PullToRefreshListView$InternalListViewSDK9) with Adapter(class android.widget.HeaderViewListAdapter)]
问题出现原因分析和解决方法,在http://www.daxueit.com/article/4671.html中都有说明,这里mark下.
解决方案总结:将修改adapter 数据和调用notifyDataSetChanged()方法都放在主线程中线性执行,防止多线程调度引起概率性notifyDataSetChanged() 通知延时,从而crash。