[Android] Properly pop backstack to browsers root level

Geoffrey Métais git at videolan.org
Mon Aug 21 14:58:31 CEST 2017


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Mon Aug 21 14:57:33 2017 +0200| [0b4a407b2aaae1b0aa5015203d121ac4a9cad2c9] | committer: Geoffrey Métais

Properly pop backstack to browsers root level

> https://code.videolan.org/videolan/vlc-android/commit/0b4a407b2aaae1b0aa5015203d121ac4a9cad2c9
---

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

diff --git a/vlc-android/src/org/videolan/vlc/gui/MainActivity.java b/vlc-android/src/org/videolan/vlc/gui/MainActivity.java
index 3040decee..dd7c937b9 100644
--- a/vlc-android/src/org/videolan/vlc/gui/MainActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/MainActivity.java
@@ -649,17 +649,17 @@ public class MainActivity extends ContentActivity implements FilterQueryProvider
                 return false;
             }
 
-            if(mCurrentFragmentId == id) { /* Already selected */
+            if (mCurrentFragmentId == id) { /* Already selected */
                 // Go back at root level of current browser
                 if (current instanceof BaseBrowserFragment && !((BaseBrowserFragment) current).isRootDirectory()) {
-                    clearBackstackFromClass(current.getClass());
+                    getSupportFragmentManager().popBackStack(getTag(id), FragmentManager.POP_BACK_STACK_INCLUSIVE);
                 } else {
                     mDrawerLayout.closeDrawer(mNavigationView);
                     return false;
                 }
             }
 
-            switch (id){
+            switch (id) {
                 case R.id.nav_about:
                     showSecondaryFragment(SecondaryActivity.ABOUT);
                     break;



More information about the Android mailing list