* commit 'dddd6b15d5274a6138facec9f553336fac5f6de6': Fix when managed cursors are required.
This commit is contained in:
@ -4421,27 +4421,29 @@ public class Activity extends ContextThemeWrapper
|
|||||||
final void performRestart() {
|
final void performRestart() {
|
||||||
mFragments.noteStateNotSaved();
|
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) {
|
if (mStopped) {
|
||||||
mStopped = false;
|
mStopped = false;
|
||||||
mCalled = false;
|
|
||||||
if (mToken != null && mParent == null) {
|
if (mToken != null && mParent == null) {
|
||||||
WindowManagerImpl.getDefault().setStoppedState(mToken, false);
|
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);
|
mInstrumentation.callActivityOnRestart(this);
|
||||||
if (!mCalled) {
|
if (!mCalled) {
|
||||||
throw new SuperNotCalledException(
|
throw new SuperNotCalledException(
|
||||||
|
Reference in New Issue
Block a user