Automated import from //branches/master/...@142130,142130
diff --git a/core/java/android/widget/ListView.java b/core/java/android/widget/ListView.java
index 4d5032e..7e30f7b 100644
--- a/core/java/android/widget/ListView.java
+++ b/core/java/android/widget/ListView.java
@@ -1393,6 +1393,11 @@
                 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.");
             }
 
             setSelectedPositionInt(mNextSelectedPosition);