[Android] Bind AudioService for group view

Geoffrey Métais git at videolan.org
Tue Mar 24 11:55:55 CET 2015


vlc-ports/android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Tue Mar 24 11:54:41 2015 +0100| [8867723edded8907042f7bed2012d87839fe6211] | committer: Geoffrey Métais

Bind AudioService for group view

> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=8867723edded8907042f7bed2012d87839fe6211
---

 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 d96212c..8d1e5c7 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.java
@@ -169,7 +169,6 @@ public class VideoGridFragment extends BrowserFragment implements ISortable, IVi
         filter.addAction(Util.ACTION_SCAN_START);
         filter.addAction(Util.ACTION_SCAN_STOP);
         getActivity().registerReceiver(messageReceiverVideoListFragment, filter);
-        Log.i(TAG, "mMediaLibrary.isWorking() " + Boolean.toString(mMediaLibrary.isWorking()));
         if (mMediaLibrary.isWorking()) {
             Util.actionScanStart();
         }
@@ -180,6 +179,8 @@ public class VideoGridFragment extends BrowserFragment implements ISortable, IVi
     @Override
     public void onPause() {
         super.onPause();
+        if (!(getActivity() instanceof MainActivity))
+            AudioServiceController.getInstance().unbindAudioService(getActivity());
         mGVFirstVisiblePos = mGridView.getFirstVisiblePosition();
         mMediaLibrary.removeUpdateHandler(mHandler);
 
@@ -191,6 +192,8 @@ public class VideoGridFragment extends BrowserFragment implements ISortable, IVi
     @Override
     public void onResume() {
         super.onResume();
+        if (!(getActivity() instanceof MainActivity))
+            AudioServiceController.getInstance().bindAudioService(getActivity());
         mMediaLibrary.addUpdateHandler(mHandler);
         final boolean refresh = mVideoAdapter.isEmpty();
         if (refresh)



More information about the Android mailing list