[Android] Fix IllegalStateException

Nicolas Pomepuy git at videolan.org
Tue Aug 27 13:01:56 CEST 2019


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

Fix IllegalStateException

(cherry picked from commit 19a9836296be381910737ccd47610e372291a508)

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

 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