[Android] Commit browsing transaction if fragment is visible

Geoffrey Métais git at videolan.org
Fri Oct 13 15:47:51 CEST 2017


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Fri Oct 13 09:39:11 2017 +0200| [d49991853519c085f80486fe162e4204d1209f0e] | committer: Geoffrey Métais

Commit browsing transaction if fragment is visible

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

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

diff --git a/vlc-android/src/org/videolan/vlc/gui/browser/BaseBrowserFragment.java b/vlc-android/src/org/videolan/vlc/gui/browser/BaseBrowserFragment.java
index c041f31f3..6474d3870 100644
--- a/vlc-android/src/org/videolan/vlc/gui/browser/BaseBrowserFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/browser/BaseBrowserFragment.java
@@ -286,6 +286,8 @@ public abstract class BaseBrowserFragment extends SortableFragment<BaseBrowserAd
     }
 
     public void browse(MediaWrapper media, int position, boolean save) {
+        if (!isResumed() || isRemoving())
+            return;
         mBrowserHandler.removeCallbacksAndMessages(null);
         final FragmentTransaction ft = getActivity().getSupportFragmentManager().beginTransaction();
         final Fragment next = createFragment();



More information about the Android mailing list