Skip to content

Commit 3751090

Browse files
committed
Bug 5535639 - Monkeys mad at FragmentManager
Also check for starting deferred start fragments when a loader is destroyed. Change-Id: Ia17a902c579c09d7ac01079c7c1da137635aa08b
1 parent 6d4b9f0 commit 3751090

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

core/java/android/app/FragmentManager.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1025,6 +1025,8 @@ void moveToState(int newState, int transit, int transitStyle, boolean always) {
10251025
}
10261026

10271027
void startPendingDeferredFragments() {
1028+
if (mActive == null) return;
1029+
10281030
for (int i=0; i<mActive.size(); i++) {
10291031
Fragment f = mActive.get(i);
10301032
if (f != null) {

core/java/android/app/LoaderManager.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,7 @@ void destroy() {
419419
mInactiveLoaders.remove(mId);
420420
}
421421

422-
if (!hasRunningLoaders() && mActivity != null) {
422+
if (mActivity != null && !hasRunningLoaders()) {
423423
mActivity.mFragments.startPendingDeferredFragments();
424424
}
425425
}
@@ -681,6 +681,9 @@ public void destroyLoader(int id) {
681681
mInactiveLoaders.removeAt(idx);
682682
info.destroy();
683683
}
684+
if (mActivity != null && !hasRunningLoaders()) {
685+
mActivity.mFragments.startPendingDeferredFragments();
686+
}
684687
}
685688

686689
/**

0 commit comments

Comments
 (0)