From a5445d3bbd7985ffeeeabc3813bec3d1e0463cea Mon Sep 17 00:00:00 2001 From: Dianne Hackborn Date: Thu, 1 Sep 2011 14:38:24 -0700 Subject: Fix issue #5039287: Listen dies on back key on ICS but not on Gingerbread Change-Id: I77c63a8c372ff7a8459a1e8cf6fd1b37f320e3ce --- core/java/android/app/Activity.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'core/java/android/app') diff --git a/core/java/android/app/Activity.java b/core/java/android/app/Activity.java index 0e3eaaa..41e3fdf 100644 --- a/core/java/android/app/Activity.java +++ b/core/java/android/app/Activity.java @@ -4471,9 +4471,12 @@ public class Activity extends ContextThemeWrapper ManagedCursor mc = mManagedCursors.get(i); if (mc.mReleased || mc.mUpdated) { if (!mc.mCursor.requery()) { - throw new IllegalStateException( - "trying to requery an already closed cursor " - + mc.mCursor); + if (getApplicationInfo().targetSdkVersion + >= android.os.Build.VERSION_CODES.ICE_CREAM_SANDWICH) { + throw new IllegalStateException( + "trying to requery an already closed cursor " + + mc.mCursor); + } } mc.mReleased = false; mc.mUpdated = false; -- cgit v1.1