zoukankan      html  css  js  c++  java
  • The content of the adapter has changed but ListView did not receive a notification

      问题原因: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)
  • 相关阅读:
    What is the purpose of FormsAuthenticationTicket isPersistent property?
    Forms Authentication configurations
    What is the difference between localStorage, sessionStorage, session and cookies?
    Set-Cookie
    申威机器信息
    systemctl 关闭图形界面的办法
    sourcetree 使用
    在 Web 项目中应用 Apache Shiro
    移动web开发框架
    从0开始搭建symphony
  • 原文地址:https://www.cnblogs.com/shaweng/p/2571221.html
Copyright © 2011-2022 走看看