报下面的错,我确定没有在线程中更新adapter,我是在handler中更新的,然后再用notifyDataSet,牛人们,知道是什么原因吗??急啊~~~~~~~~~~~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(2131361804, class com.wangzhi.MaMaHelp.PullToRefreshListView) with Adapter(class android.widget.HeaderViewListAdapter)] 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(2131361804, class com.wangzhi.MaMaHelp.PullToRefreshListView) with Adapter(class android.widget.HeaderViewListAdapter)] at android.widget.ListView.layoutChildren(ListView.java:1524) at android.widget.AbsListView.onLayout(AbsListView.java:1309) at android.view.View.layout(View.java:7175) at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1254) at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1130) at android.widget.LinearLayout.onLayout(LinearLayout.java:1047) at android.view.View.layout(View.java:7175) at android.widget.RelativeLayout.onLayout(RelativeLayout.java:912) at android.view.View.layout(View.java:7175) at android.widget.FrameLayout.onLayout(FrameLayout.java:338) at android.view.View.layout(View.java:7175) at android.widget.FrameLayout.onLayout(FrameLayout.java:338) at android.view.View.layout(View.java:7175) at android.view.ViewRoot.performTraversals(ViewRoot.java:1143) at android.view.ViewRoot.handleMessage(ViewRoot.java:1862) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:130) at android.app.ActivityThread.main(ActivityThread.java:3694) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:507) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:870) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:628) at dalvik.system.NativeStart.main(Native Method)

解决方案 »

  1.   

    同问楼主,请问解决了吗?我也是,而且也是在提示在HeaderViewListAdapter出错,我后来给成了在notifydatesetchanged的地方改成先判断if(adapter == null) adapter = new ………()else adapter.notifydatasetchanged,并且去掉原先new的语句,这样改似乎就再也没出现过类似错误了,不过我感觉这样的代码编写方式不好,所以请问楼主有新的解决方案吗
      

  2.   

    来看看这个贴子
    http://www.eoeandroid.com/thread-79950-1-1.html