[Android] Navigator: Normal commit in debug builds

Geoffrey Métais git at videolan.org
Thu Jan 17 12:32:57 CET 2019


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Thu Jan 17 08:31:45 2019 +0100| [6ecaffefd1d0af6f57f05bdc4249fc5540239ca3] | committer: Geoffrey Métais

Navigator: Normal commit in debug builds

This is to track down fragments management bugs

> https://code.videolan.org/videolan/vlc-android/commit/6ecaffefd1d0af6f57f05bdc4249fc5540239ca3
---

 vlc-android/src/org/videolan/vlc/gui/helpers/Navigator.kt | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

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 bf8c28c08..19dad1882 100644
--- a/vlc-android/src/org/videolan/vlc/gui/helpers/Navigator.kt
+++ b/vlc-android/src/org/videolan/vlc/gui/helpers/Navigator.kt
@@ -35,6 +35,7 @@ import androidx.lifecycle.LifecycleObserver
 import androidx.lifecycle.OnLifecycleEvent
 import kotlinx.coroutines.ExperimentalCoroutinesApi
 import kotlinx.coroutines.ObsoleteCoroutinesApi
+import org.videolan.vlc.BuildConfig
 import org.videolan.vlc.R
 import org.videolan.vlc.extensions.ExtensionManagerService
 import org.videolan.vlc.extensions.api.VLCExtensionItem
@@ -115,7 +116,8 @@ class Navigator(private val activity: MainActivity,
             fm.popBackStackImmediate("root", FragmentManager.POP_BACK_STACK_INCLUSIVE)
         val ft = fm.beginTransaction()
         ft.replace(R.id.fragment_placeholder, fragment, tag)
-        ft.commitAllowingStateLoss()
+        if (BuildConfig.DEBUG) ft.commit()
+        else ft.commitAllowingStateLoss()
         activity.updateCheckedItem(id)
         currentFragment = fragment
         currentFragmentId = id



More information about the Android mailing list