问题原因:Adapter数据更新后,没有及时使用notifyDataSetChanged()方法通知UI,导致出现数据不一致而报错。
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(2131690143, class android.widget.ListView) with Adapter(class com.hotalk.ui.homepage.favorites.FavoritesListAdapter)] at android.widget.ListView.layoutChildren(ListView.java:1510) at android.widget.AbsListView.onLayout(AbsListView.java:1260) at android.view.View.layout(View.java:7204) at android.widget.RelativeLayout.onLayout(RelativeLayout.java:912) at android.view.View.layout(View.java:7204) at com.hotalk.util.slider.ViewFlow.onLayout(ViewFlow.java:222) at android.view.View.layout(View.java:7204) at android.widget.RelativeLayout.onLayout(RelativeLayout.java:912) at android.view.View.layout(View.java:7204) at android.widget.RelativeLayout.onLayout(RelativeLayout.java:912) at android.view.View.layout(View.java:7204) at android.widget.RelativeLayout.onLayout(RelativeLayout.java:912) at android.view.View.layout(View.java:7204) 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:7204) at android.widget.FrameLayout.onLayout(FrameLayout.java:338) at android.view.View.layout(View.java:7204) at android.widget.FrameLayout.onLayout(FrameLayout.java:338) at android.view.View.layout(View.java:7204) at android.widget.FrameLayout.onLayout(FrameLayout.java:338) at android.view.View.layout(View.java:7204) 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:7204) at android.widget.FrameLayout.onLayout(FrameLayout.java:338) at android.view.View.layout(View.java:7204) at android.widget.FrameLayout.onLayout(FrameLayout.java:338) at android.view.View.layout(View.java:7204) at android.widget.FrameLayout.onLayout(FrameLayout.java:338) at android.view.View.layout(View.java:7204) at android.view.ViewRoot.performTraversals(ViewRoot.java:1142) at android.view.ViewRoot.handleMessage(ViewRoot.java:1861) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:130) at android.app.ActivityThread.main(ActivityThread.java:3683) 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:895) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:653) at dalvik.system.NativeStart.main(Native Method)