[Android] PlaybackService: unregister callback before stop
Thomas Guillem
git at videolan.org
Fri Jul 10 19:38:10 CEST 2015
vlc-ports/android | branch: master | Thomas Guillem <thomas at gllm.fr> | Fri Jul 10 19:33:47 2015 +0200| [eb74fa1346d83542e6cf7a0124e0c3e366122cc2] | committer: Thomas Guillem
PlaybackService: unregister callback before stop
> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=eb74fa1346d83542e6cf7a0124e0c3e366122cc2
---
vlc-android/src/org/videolan/vlc/gui/audio/AudioPlayer.java | 3 ++-
.../org/videolan/vlc/gui/tv/audioplayer/AudioPlayerActivity.java | 3 ++-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/vlc-android/src/org/videolan/vlc/gui/audio/AudioPlayer.java b/vlc-android/src/org/videolan/vlc/gui/audio/AudioPlayer.java
index 9afcdc9..f5d98ec 100644
--- a/vlc-android/src/org/videolan/vlc/gui/audio/AudioPlayer.java
+++ b/vlc-android/src/org/videolan/vlc/gui/audio/AudioPlayer.java
@@ -659,9 +659,10 @@ public class AudioPlayer extends PlaybackServiceFragment implements PlaybackServ
@Override
public void onStop() {
- super.onStop();
+ /* unregister before super.onStop() since mService is set to null from this call */
if (mService != null)
mService.removeCallback(this);
+ super.onStop();
}
class LongSeekListener implements View.OnTouchListener {
diff --git a/vlc-android/tv/src/org/videolan/vlc/gui/tv/audioplayer/AudioPlayerActivity.java b/vlc-android/tv/src/org/videolan/vlc/gui/tv/audioplayer/AudioPlayerActivity.java
index 038e4aa..ed91140 100644
--- a/vlc-android/tv/src/org/videolan/vlc/gui/tv/audioplayer/AudioPlayerActivity.java
+++ b/vlc-android/tv/src/org/videolan/vlc/gui/tv/audioplayer/AudioPlayerActivity.java
@@ -103,9 +103,10 @@ public class AudioPlayerActivity extends BaseTvActivity implements PlaybackServi
@Override
protected void onStop() {
- super.onStop();
+ /* unregister before super.onStop() since mService is set to null from this call */
if (mService != null)
mService.removeCallback(this);
+ super.onStop();
}
protected void onResume() {
More information about the Android
mailing list