[Android] Fix IllegalStateException

Nicolas Pomepuy git at videolan.org
Mon Aug 26 13:39:07 CEST 2019


vlc-android | branch: master | Nicolas Pomepuy <nicolas.pomepuy at gmail.com> | Mon Aug 26 09:27:58 2019 +0200| [19a9836296be381910737ccd47610e372291a508] | committer: Nicolas Pomepuy

Fix IllegalStateException

> https://code.videolan.org/videolan/vlc-android/commit/19a9836296be381910737ccd47610e372291a508
---

 vlc-android/src/org/videolan/vlc/gui/browser/BaseBrowserFragment.kt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/vlc-android/src/org/videolan/vlc/gui/browser/BaseBrowserFragment.kt b/vlc-android/src/org/videolan/vlc/gui/browser/BaseBrowserFragment.kt
index 8fc7083eb..8b27d2622 100644
--- a/vlc-android/src/org/videolan/vlc/gui/browser/BaseBrowserFragment.kt
+++ b/vlc-android/src/org/videolan/vlc/gui/browser/BaseBrowserFragment.kt
@@ -208,7 +208,7 @@ abstract class BaseBrowserFragment : MediaBrowserFragment<BrowserModel>(), IRefr
 
     fun goBack(): Boolean {
         val activity = activity ?: return false
-        if (!isRootDirectory) activity.supportFragmentManager.popBackStack()
+        if (!isRootDirectory && !activity.isFinishing && !activity.isDestroyed) activity.supportFragmentManager.popBackStack()
         return !isRootDirectory
     }
 



More information about the Android mailing list