[Android] Update current fragment ref only when necessary

Geoffrey Métais git at videolan.org
Wed Sep 13 13:44:40 CEST 2017


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Wed Sep 13 13:10:37 2017 +0200| [773128bb6e15d8d0bcb8439c9d2ad2c21bf57dab] | committer: Geoffrey Métais

Update current fragment ref only when necessary

> https://code.videolan.org/videolan/vlc-android/commit/773128bb6e15d8d0bcb8439c9d2ad2c21bf57dab
---

 vlc-android/src/org/videolan/vlc/gui/MainActivity.java | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/gui/MainActivity.java b/vlc-android/src/org/videolan/vlc/gui/MainActivity.java
index 7857dec79..68976086d 100644
--- a/vlc-android/src/org/videolan/vlc/gui/MainActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/MainActivity.java
@@ -652,9 +652,10 @@ public class MainActivity extends ContentActivity implements FilterQueryProvider
                 fm.beginTransaction().remove(mCurrentFragment).commit();
             else {
                 if (mCurrentFragment instanceof BaseBrowserFragment
-                        && !((BaseBrowserFragment) mCurrentFragment).isRootDirectory())
+                        && !((BaseBrowserFragment) mCurrentFragment).isRootDirectory()) {
                     getSupportFragmentManager().popBackStackImmediate(getTag(id), FragmentManager.POP_BACK_STACK_INCLUSIVE);
-                mCurrentFragment = getCurrentFragment();
+                    mCurrentFragment = getCurrentFragment();
+                }
                 fm.beginTransaction().hide(mCurrentFragment).commit();
             }
         FragmentTransaction ft = fm.beginTransaction();



More information about the Android mailing list