[Android] Always clean browser fragments on category change

Geoffrey Métais git at videolan.org
Tue Feb 26 15:32:27 CET 2019


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Tue Feb 26 15:31:59 2019 +0100| [8438d78a71df7a1c9c3668d05b5f9fdead0ff916] | committer: Geoffrey Métais

Always clean browser fragments on category change

> https://code.videolan.org/videolan/vlc-android/commit/8438d78a71df7a1c9c3668d05b5f9fdead0ff916
---

 vlc-android/src/org/videolan/vlc/gui/helpers/Navigator.kt | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/gui/helpers/Navigator.kt b/vlc-android/src/org/videolan/vlc/gui/helpers/Navigator.kt
index 19dad1882..8ee8446f8 100644
--- a/vlc-android/src/org/videolan/vlc/gui/helpers/Navigator.kt
+++ b/vlc-android/src/org/videolan/vlc/gui/helpers/Navigator.kt
@@ -112,8 +112,7 @@ class Navigator(private val activity: MainActivity,
 
     private fun showFragment(fragment: Fragment, id: Int, tag: String = getTag(id)) {
         val fm = activity.supportFragmentManager
-        if (currentFragment is BaseBrowserFragment && !(currentFragment as BaseBrowserFragment).isRootDirectory)
-            fm.popBackStackImmediate("root", FragmentManager.POP_BACK_STACK_INCLUSIVE)
+        if (currentFragment is BaseBrowserFragment) fm.popBackStackImmediate("root", FragmentManager.POP_BACK_STACK_INCLUSIVE)
         val ft = fm.beginTransaction()
         ft.replace(R.id.fragment_placeholder, fragment, tag)
         if (BuildConfig.DEBUG) ft.commit()



More information about the Android mailing list