12-16 15:33:59.338 27587-27587/? E/InputEventReceiver: Exception dispatching input event.
12-16 15:33:59.338 27587-27587/? E/MessageQueue-JNI: Exception in MessageQueue callback: handleReceiveCallback
12-16 15:33:59.359 27587-27587/? E/MessageQueue-JNI: 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. Make sure your adapter calls notifyDataSetChanged() when its content changes. [in ListView(2131165248, class com.whf.demo.TestListView) with Adapter(class com.whf.demo.ListAdapter)]
at android.widget.ListView.layoutChildren(ListView.java:1620)
at android.widget.AbsListView.onTouchUp(AbsListView.java:4217)
at android.widget.AbsListView.onTouchEvent(AbsListView.java:3986)
at android.view.View.dispatchTouchEvent(View.java:10038)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2666)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2347)
at android.widget.AbsListView.dispatchTouchEvent(AbsListView.java:986)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2672)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2361)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2672)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2361)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2672)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2361)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2672)
... ...
错误来源
//ListView.java
@Override
protected void layoutChildren() {
... ...
if (mItemCount == 0) {
resetList();
invokeOnItemScrollListener();
return;
} else if (mItemCount != mAdapter.getCount()) {
throw new 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. Make sure your adapter calls notifyDataSetChanged() "
+ "when its content changes. [in ListView(" + getId() + ", " + getClass()
+ ") with Adapter(" + mAdapter.getClass() + ")]");
}
... ...
}