From 7d8314db41707a98afb269a78e7bc90ac75d37fc Mon Sep 17 00:00:00 2001 From: Alan Viverette Date: Tue, 10 Sep 2013 11:22:53 -0700 Subject: [PATCH] Make ListView's illegal state exception more helpful Change-Id: I3d3205d32c6992c184a218248ba72ebf6c45a2d1 --- core/java/android/widget/ListView.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/core/java/android/widget/ListView.java b/core/java/android/widget/ListView.java index 389d9d64158e6..b239fbd70706e 100644 --- a/core/java/android/widget/ListView.java +++ b/core/java/android/widget/ListView.java @@ -1555,8 +1555,9 @@ public class ListView extends AbsListView { } 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. [in ListView(" + getId() + ", " + getClass() + + "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() + ")]"); }