diff options
author | Adam Powell <adamp@google.com> | 2011-10-31 11:48:24 -0700 |
---|---|---|
committer | Adam Powell <adamp@google.com> | 2011-10-31 11:48:24 -0700 |
commit | 37510908a7b570accb2c4829842790b3d9d3a102 (patch) | |
tree | 5a2a52b08e5d620b6c917aa55e5cc8c12f6c12c1 | |
parent | 6d4b9f0b409dd15d8ada0a990f9c5785bdbd2e9f (diff) | |
download | frameworks_base-37510908a7b570accb2c4829842790b3d9d3a102.zip frameworks_base-37510908a7b570accb2c4829842790b3d9d3a102.tar.gz frameworks_base-37510908a7b570accb2c4829842790b3d9d3a102.tar.bz2 |
Bug 5535639 - Monkeys mad at FragmentManager
Also check for starting deferred start fragments when a loader is
destroyed.
Change-Id: Ia17a902c579c09d7ac01079c7c1da137635aa08b
-rw-r--r-- | core/java/android/app/FragmentManager.java | 2 | ||||
-rw-r--r-- | core/java/android/app/LoaderManager.java | 5 |
2 files changed, 6 insertions, 1 deletions
diff --git a/core/java/android/app/FragmentManager.java b/core/java/android/app/FragmentManager.java index 58cd27c..85aec4c 100644 --- a/core/java/android/app/FragmentManager.java +++ b/core/java/android/app/FragmentManager.java @@ -1025,6 +1025,8 @@ final class FragmentManagerImpl extends FragmentManager { } void startPendingDeferredFragments() { + if (mActive == null) return; + for (int i=0; i<mActive.size(); i++) { Fragment f = mActive.get(i); if (f != null) { diff --git a/core/java/android/app/LoaderManager.java b/core/java/android/app/LoaderManager.java index aef0c6f..1b8a4f5 100644 --- a/core/java/android/app/LoaderManager.java +++ b/core/java/android/app/LoaderManager.java @@ -419,7 +419,7 @@ class LoaderManagerImpl extends LoaderManager { mInactiveLoaders.remove(mId); } - if (!hasRunningLoaders() && mActivity != null) { + if (mActivity != null && !hasRunningLoaders()) { mActivity.mFragments.startPendingDeferredFragments(); } } @@ -681,6 +681,9 @@ class LoaderManagerImpl extends LoaderManager { mInactiveLoaders.removeAt(idx); info.destroy(); } + if (mActivity != null && !hasRunningLoaders()) { + mActivity.mFragments.startPendingDeferredFragments(); + } } /** |