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)
  • 相关阅读:
    完成一个Laravel项目的过程
    composer的安装以及具体使用
    mongoDB命令
    test
    豆瓣自动注册、回贴脚本 powered by Python & Selenium
    memcache和redis的对比
    高并发下缓存和数据库一致性问题(更新淘汰缓存不得不注意的细节)
    使用PHP连接、操纵Memcached的原理和教程
    php面向对象 ::、->、self、$this几种操作符的区别介绍
    nginx url 重写
  • 原文地址:https://www.cnblogs.com/shaweng/p/2571221.html
Copyright © 2011-2022 走看看