[Android] Refresh videos on video fragment restart

Geoffrey Métais git at videolan.org
Wed Apr 4 18:35:44 CEST 2018


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Wed Mar 21 13:57:04 2018 +0100| [1c5f699b2d920548ba7c77a28ded2c4248eeaba8] | committer: Geoffrey Métais

Refresh videos on video fragment restart

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

 vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.java | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.java b/vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.java
index 3946c86b5..6530699c1 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.java
@@ -144,6 +144,7 @@ public class VideoGridFragment extends MediaBrowserFragment<VideosProvider> impl
         });
     }
 
+    private boolean restart = false;
     @Override
     public void onStart() {
         super.onStart();
@@ -152,12 +153,14 @@ public class VideoGridFragment extends MediaBrowserFragment<VideosProvider> impl
         updateViewMode();
         mFabPlay.setImageResource(R.drawable.ic_fab_play);
         setFabPlayVisibility(true);
+        if (restart) mProvider.refresh();
     }
 
     @Override
     public void onStop() {
         super.onStop();
-            unregisterForContextMenu(mGridView);
+        unregisterForContextMenu(mGridView);
+        restart = true;
     }
 
     @Override



More information about the Android mailing list