diff options
author | daniel oeh <daniel.oeh@gmail.com> | 2013-01-16 15:37:29 +0100 |
---|---|---|
committer | daniel oeh <daniel.oeh@gmail.com> | 2013-01-16 15:37:29 +0100 |
commit | cd40d839fcc7146ab747eee8822d59fbd5579255 (patch) | |
tree | 45eec77df11177dc06f4569af997510b8f52c6f8 | |
parent | fdc4bc9c1d483d4727d4e4dcc98e86becf09ab6e (diff) | |
download | AntennaPod-cd40d839fcc7146ab747eee8822d59fbd5579255.zip |
Release PlaybackController when MediaplayerActivity is stopped0.9.6.4
-rw-r--r-- | src/de/danoeh/antennapod/activity/MediaplayerActivity.java | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/src/de/danoeh/antennapod/activity/MediaplayerActivity.java b/src/de/danoeh/antennapod/activity/MediaplayerActivity.java index ef381739f..a53b4f4fb 100644 --- a/src/de/danoeh/antennapod/activity/MediaplayerActivity.java +++ b/src/de/danoeh/antennapod/activity/MediaplayerActivity.java @@ -51,9 +51,8 @@ public abstract class MediaplayerActivity extends SherlockFragmentActivity protected ImageButton butRev; protected ImageButton butFF; - public MediaplayerActivity() { - super(); - controller = new PlaybackController(this, false) { + private PlaybackController newPlaybackController() { + return new PlaybackController(this, false) { @Override public void setupGUI() { @@ -130,6 +129,7 @@ public abstract class MediaplayerActivity extends SherlockFragmentActivity finish(); } }; + } protected void onServiceQueried() { @@ -185,10 +185,22 @@ public abstract class MediaplayerActivity extends SherlockFragmentActivity protected int orientation; @Override + protected void onStart() { + super.onStart(); + if (controller != null) { + controller.release(); + } + controller = newPlaybackController(); + } + + @Override protected void onStop() { super.onStop(); if (AppConfig.DEBUG) Log.d(TAG, "Activity stopped"); + if (controller != null) { + controller.release(); + } } @Override @@ -196,9 +208,6 @@ public abstract class MediaplayerActivity extends SherlockFragmentActivity super.onDestroy(); if (AppConfig.DEBUG) Log.d(TAG, "Activity destroyed"); - if (controller != null) { - controller.release(); - } } @Override |