Closed galilio closed 11 years ago
Thanks for the report. This is probably caused by a mismatch between the wrapped adapter and the wrapper. Investigating.
It is a mismatch between the adapter and the wrapper. In my case, I had a view that I animated when the ListView item got double-tapped. If I scrolled while the animation was happening, I got the following:
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(-1, class android.widget.ListView) with Adapter(class android.widget.HeaderViewListAdapter)] at android.widget.ListView.layoutChildren(ListView.java:1544)
I fixed it by removing my header and footer.
If you need to keep the header and footer, a much more hacky and basically wrong way is to override layoutChildren in your custom ListView and catch the exception. Your ListView gets reset to the top, but nothing else goes wrong. Not recommended however.
I had this problem when i removed the footer of a list, I fix it calling adapter.notifyDataSetChanged(); after the footer removing. It works for me!!
When i use AsyncListView with addFooterView for a endless listview always got
IllegalStateException: The content of the adapter has changed but ListView did not receive a notification.
I found a hacky way to solve this.
change AsyncListView as fellow:
@Override public ListAdapter getAdapter() { // if (mItemManaged != null) { // return mItemManaged.getWrappedAdapter(); // } else { // return super.getAdapter(); // } return super.getAdapter(); }
please fix this.