[Android] Fragments should not bind/unbind the activity, it' s already done by the activity itself.

Sébastien Toque git at videolan.org
Thu Sep 5 19:48:08 CEST 2013


vlc-ports/android | branch: master | Sébastien Toque <xilasz at gmail.com> | Thu Sep  5 19:33:19 2013 +0200| [c9d8db7784ec1afad00b3ea9decd77afad2a9fc5] | committer: Sébastien Toque

Fragments should not bind/unbind the activity, it's already done by the activity itself.

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

 .../src/org/videolan/vlc/gui/DirectoryViewFragment.java    |   12 ------------
 vlc-android/src/org/videolan/vlc/gui/HistoryFragment.java  |   12 ------------
 .../org/videolan/vlc/gui/audio/AudioBrowserFragment.java   |    2 --
 .../src/org/videolan/vlc/gui/audio/AudioListFragment.java  |    2 --
 .../org/videolan/vlc/gui/audio/AudioPlayerFragment.java    |    2 --
 5 files changed, 30 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/gui/DirectoryViewFragment.java b/vlc-android/src/org/videolan/vlc/gui/DirectoryViewFragment.java
index 68df901..a741468 100644
--- a/vlc-android/src/org/videolan/vlc/gui/DirectoryViewFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/DirectoryViewFragment.java
@@ -104,18 +104,6 @@ public class DirectoryViewFragment extends SherlockListFragment implements ISort
     }
 
     @Override
-    public void onResume() {
-        super.onResume();
-        AudioServiceController.getInstance().bindAudioService(getActivity());
-    }
-
-    @Override
-    public void onPause() {
-        super.onPause();
-        AudioServiceController.getInstance().unbindAudioService(getActivity());
-    }
-
-    @Override
     public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) {
         int position = ((AdapterContextMenuInfo)menuInfo).position;
 
diff --git a/vlc-android/src/org/videolan/vlc/gui/HistoryFragment.java b/vlc-android/src/org/videolan/vlc/gui/HistoryFragment.java
index d3f4665..21ba3b2 100644
--- a/vlc-android/src/org/videolan/vlc/gui/HistoryFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/HistoryFragment.java
@@ -65,18 +65,6 @@ public class HistoryFragment extends SherlockListFragment {
     }
 
     @Override
-    public void onPause() {
-        super.onPause();
-        AudioServiceController.getInstance().unbindAudioService(getActivity());
-    }
-
-    @Override
-    public void onResume() {
-        super.onResume();
-        AudioServiceController.getInstance().bindAudioService(getActivity());
-    }
-
-    @Override
     public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) {
         MenuInflater menuInflater = getActivity().getMenuInflater();
         menuInflater.inflate(R.menu.history_view, menu);
diff --git a/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserFragment.java b/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserFragment.java
index 260c3b7..2487812 100644
--- a/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserFragment.java
@@ -164,7 +164,6 @@ public class AudioBrowserFragment extends SherlockFragment implements ISortable
         super.onPause();
         mFlingViewPosition = mFlingViewGroup.getPosition();
         mMediaLibrary.removeUpdateHandler(mHandler);
-        mAudioController.unbindAudioService(getActivity());
     }
 
     @Override
@@ -174,7 +173,6 @@ public class AudioBrowserFragment extends SherlockFragment implements ISortable
         headerHighlightTab(mFlingViewGroup.getPosition(), mFlingViewPosition);
         mFlingViewGroup.setPosition(mFlingViewPosition);
         mMediaLibrary.addUpdateHandler(mHandler);
-        mAudioController.bindAudioService(getActivity());
     }
 
     OnItemClickListener songListener = new OnItemClickListener() {
diff --git a/vlc-android/src/org/videolan/vlc/gui/audio/AudioListFragment.java b/vlc-android/src/org/videolan/vlc/gui/audio/AudioListFragment.java
index 75b0beb..e4acebf 100644
--- a/vlc-android/src/org/videolan/vlc/gui/audio/AudioListFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/audio/AudioListFragment.java
@@ -101,14 +101,12 @@ public class AudioListFragment extends SherlockListFragment {
     public void onPause() {
         super.onPause();
         mMediaLibrary.removeUpdateHandler(mHandler);
-        mAudioController.unbindAudioService(getActivity());
     }
 
     @Override
     public void onResume() {
         super.onResume();
         mMediaLibrary.addUpdateHandler(mHandler);
-        mAudioController.bindAudioService(getActivity());
     }
 
     @Override
diff --git a/vlc-android/src/org/videolan/vlc/gui/audio/AudioPlayerFragment.java b/vlc-android/src/org/videolan/vlc/gui/audio/AudioPlayerFragment.java
index 4417c1e..68f66d2 100644
--- a/vlc-android/src/org/videolan/vlc/gui/audio/AudioPlayerFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/audio/AudioPlayerFragment.java
@@ -208,7 +208,6 @@ public class AudioPlayerFragment extends SherlockFragment implements IAudioPlaye
     @Override
     public void onResume() {
         super.onResume();
-        AudioServiceController.getInstance().bindAudioService(getActivity());
         mAudioController.addAudioPlayer(this);
     }
 
@@ -216,7 +215,6 @@ public class AudioPlayerFragment extends SherlockFragment implements IAudioPlaye
     public void onPause() {
         super.onPause();
         mAudioController.removeAudioPlayer(this);
-        AudioServiceController.getInstance().unbindAudioService(getActivity());
     }
 
     @Override



More information about the Android mailing list