Skip to content

Commit 1759af3

Browse files
adampAndroid (Google) Code Review
authored andcommitted
Merge "Bug 5535639 - Monkeys mad at FragmentManager" into ics-mr1
2 parents 650ee28 + 3751090 commit 1759af3

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)