[Android] Do not subscribe to ML events in group view

Geoffrey Métais git at videolan.org
Thu Apr 6 11:59:24 CEST 2017


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Thu Apr  6 11:55:37 2017 +0200| [f69d33db382ba10de8ad860b93451619c01c6660] | committer: Geoffrey Métais

Do not subscribe to ML events in group view

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

 .../src/org/videolan/vlc/gui/video/VideoGridFragment.java      | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

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 758fe07..b8c4b09 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.java
@@ -160,7 +160,7 @@ public class VideoGridFragment extends MediaBrowserFragment implements MediaUpda
         updateViewMode();
         if (mMediaLibrary.isInitiated())
             fillView();
-        else
+        else if (mGroup == null)
             setupMediaLibraryReceiver();
     }
 
@@ -197,9 +197,11 @@ public class VideoGridFragment extends MediaBrowserFragment implements MediaUpda
     }
 
     protected void fillView() {
-        mMediaLibrary.setMediaUpdatedCb(this, Medialibrary.FLAG_MEDIA_UPDATED_VIDEO);
-        mMediaLibrary.setMediaAddedCb(this, Medialibrary.FLAG_MEDIA_ADDED_VIDEO);
-        mMediaLibrary.addDeviceDiscoveryCb(this);
+        if (mGroup == null) {
+            mMediaLibrary.setMediaUpdatedCb(this, Medialibrary.FLAG_MEDIA_UPDATED_VIDEO);
+            mMediaLibrary.setMediaAddedCb(this, Medialibrary.FLAG_MEDIA_ADDED_VIDEO);
+            mMediaLibrary.addDeviceDiscoveryCb(this);
+        }
         mHandler.sendEmptyMessage(UPDATE_LIST);
     }
 



More information about the Android mailing list