diff options
author | Dianne Hackborn <hackbod@google.com> | 2011-06-03 15:26:01 -0700 |
---|---|---|
committer | Dianne Hackborn <hackbod@google.com> | 2011-06-03 15:26:40 -0700 |
commit | 185e3e243ee1da136bcace854026b8abaf0c4c86 (patch) | |
tree | a40ddd7ff229ab3972927c8c667830c30151f12f /core | |
parent | b4b44bd32983e154f2ad61b99809ed6cedd46d47 (diff) | |
download | frameworks_base-185e3e243ee1da136bcace854026b8abaf0c4c86.zip frameworks_base-185e3e243ee1da136bcace854026b8abaf0c4c86.tar.gz frameworks_base-185e3e243ee1da136bcace854026b8abaf0c4c86.tar.bz2 |
Fix when managed cursors are required.
Only do this when we are actually restarting, not when we
are just resuming after a pause.
Change-Id: I32fd263917b03776efca8e096d0343107721398d
Diffstat (limited to 'core')
-rw-r--r-- | core/java/android/app/Activity.java | 34 |
1 files changed, 18 insertions, 16 deletions
diff --git a/core/java/android/app/Activity.java b/core/java/android/app/Activity.java index e3fb358..b739e10 100644 --- a/core/java/android/app/Activity.java +++ b/core/java/android/app/Activity.java @@ -4421,27 +4421,29 @@ public class Activity extends ContextThemeWrapper final void performRestart() { mFragments.noteStateNotSaved(); - synchronized (mManagedCursors) { - final int N = mManagedCursors.size(); - for (int i=0; i<N; i++) { - 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.mReleased = false; - mc.mUpdated = false; - } - } - } - if (mStopped) { mStopped = false; - mCalled = false; if (mToken != null && mParent == null) { WindowManagerImpl.getDefault().setStoppedState(mToken, false); } + + synchronized (mManagedCursors) { + final int N = mManagedCursors.size(); + for (int i=0; i<N; i++) { + 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); + } + mc.mReleased = false; + mc.mUpdated = false; + } + } + } + + mCalled = false; mInstrumentation.callActivityOnRestart(this); if (!mCalled) { throw new SuperNotCalledException( |