【发布时间】:2017-11-28 12:21:15
【问题描述】:
请帮我找到这个错误的修复程序,它出现在生产版本中,我不知道下面日志中的错误到底在哪里。
我从 Crashlytics 得到以下日志报告:
ListView.java line 1557
android.widget.ListView.layoutChildren
Fatal Exception: 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(2131558802, class
android.widget.ListView) with Adapter(class
android.widget.HeaderViewListAdapter)]
at android.widget.ListView.layoutChildren(ListView.java:1557)
at android.widget.AbsListView.onTouchEvent(AbsListView.java:3442)
at android.view.View.dispatchTouchEvent(View.java:7565)
.
.
.
【问题讨论】:
-
可能你错过了通知数据更改
adapter.notifyDataSetChanged();
标签: android listview android-studio android-adapter