diff options
author | Adam Powell <adamp@google.com> | 2011-11-02 14:30:47 -0700 |
---|---|---|
committer | Adam Powell <adamp@google.com> | 2011-11-02 14:30:47 -0700 |
commit | 2db4e4bd1b5a2b11b07b870660b7f4b3e1f07061 (patch) | |
tree | 72370337781e4ab3960a9e2fa20c9e69ab4d3288 /core/java/android | |
parent | 7a5a50c12f6a6e094d1e8aa7514df37f1176354a (diff) | |
download | frameworks_base-2db4e4bd1b5a2b11b07b870660b7f4b3e1f07061.zip frameworks_base-2db4e4bd1b5a2b11b07b870660b7f4b3e1f07061.tar.gz frameworks_base-2db4e4bd1b5a2b11b07b870660b7f4b3e1f07061.tar.bz2 |
Fix bug 5557267 - [ViewPager] non-primary fragments unnecessary
stopped if "defer start" is enabled
Only revise the target state in moveToState if it would cross the
stopped/started boundary.
Change-Id: I8f6e400331157eac9343261117cf633611fc1e4d
Diffstat (limited to 'core/java/android')
-rw-r--r-- | core/java/android/app/FragmentManager.java | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/core/java/android/app/FragmentManager.java b/core/java/android/app/FragmentManager.java index 85aec4c..c4ba778 100644 --- a/core/java/android/app/FragmentManager.java +++ b/core/java/android/app/FragmentManager.java @@ -725,8 +725,9 @@ final class FragmentManagerImpl extends FragmentManager { // While removing a fragment, we can't change it to a higher state. newState = f.mState; } - // Defer start if requested; don't allow it to move to STARTED or higher. - if (f.mDeferStart && newState > Fragment.STOPPED) { + // Defer start if requested; don't allow it to move to STARTED or higher + // if it's not already started. + if (f.mDeferStart && f.mState < Fragment.STARTED && newState > Fragment.STOPPED) { newState = Fragment.STOPPED; } if (f.mState < newState) { |