[Android] Browsers: release breadcrumb adapter

Geoffrey Métais git at videolan.org
Mon Apr 1 17:59:10 CEST 2019


vlc-android | branch: 3.1.x | Geoffrey Métais <geoffrey.metais at gmail.com> | Mon Apr  1 17:47:34 2019 +0200| [708e8f3999fa88d13b916035301a4b42adb40fbb] | committer: Geoffrey Métais

Browsers: release breadcrumb adapter

(cherry picked from commit 78ec0c3ba7eb70bb0b5e5458d3883af547d8c2d5)

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

 .../src/org/videolan/vlc/gui/browser/MediaBrowserFragment.java    | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/vlc-android/src/org/videolan/vlc/gui/browser/MediaBrowserFragment.java b/vlc-android/src/org/videolan/vlc/gui/browser/MediaBrowserFragment.java
index e1c902e6f..1501e0284 100644
--- a/vlc-android/src/org/videolan/vlc/gui/browser/MediaBrowserFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/browser/MediaBrowserFragment.java
@@ -98,7 +98,6 @@ public abstract class MediaBrowserFragment<T extends SortableModel> extends Frag
         mSwipeRefreshLayout = view.findViewById(R.id.swipeLayout);
         mSwipeRefreshLayout.setColorSchemeResources(R.color.orange700);
         if (hasFAB()) mFabPlay = requireActivity().findViewById(R.id.fab);
-        setBreadcrumb();
     }
 
     protected boolean hasFAB() {
@@ -110,9 +109,15 @@ public abstract class MediaBrowserFragment<T extends SortableModel> extends Frag
         if (ariane != null) ariane.setVisibility(View.GONE);
     }
 
+    protected void releaseBreadCrumb() {
+        final RecyclerView ariane = requireActivity().findViewById(R.id.ariane);
+        if (ariane != null) ariane.setAdapter(null);
+    }
+
     @Override
     public void onStart() {
         super.onStart();
+        setBreadcrumb();
         updateActionBar();
         if (mFabPlay != null) {
             setFabPlayVisibility(true);
@@ -131,6 +136,7 @@ public abstract class MediaBrowserFragment<T extends SortableModel> extends Frag
     @Override
     public void onStop() {
         super.onStop();
+        releaseBreadCrumb();
         setFabPlayVisibility(false);
         restart = true;
     }



More information about the Android mailing list