diff options
author | daniel oeh <daniel.oeh@gmail.com> | 2012-09-26 20:28:16 +0200 |
---|---|---|
committer | daniel oeh <daniel.oeh@gmail.com> | 2012-09-26 20:28:16 +0200 |
commit | 258a6acd6eda93c9921d551b6c5e528dc6f9e40c (patch) | |
tree | 8a7cdf8c74b018bf6b866fa2c9299bde1f1f0ede /src | |
parent | 0f76583344bec341eb54f0f43aae69f5a97074c4 (diff) | |
download | AntennaPod-258a6acd6eda93c9921d551b6c5e528dc6f9e40c.zip |
Fixed crash when removing feed
Diffstat (limited to 'src')
-rw-r--r-- | src/de/danoeh/antennapod/fragment/ExternalPlayerFragment.java | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/de/danoeh/antennapod/fragment/ExternalPlayerFragment.java b/src/de/danoeh/antennapod/fragment/ExternalPlayerFragment.java index 276633870..61cafca54 100644 --- a/src/de/danoeh/antennapod/fragment/ExternalPlayerFragment.java +++ b/src/de/danoeh/antennapod/fragment/ExternalPlayerFragment.java @@ -53,7 +53,7 @@ public class ExternalPlayerFragment extends SherlockFragment { txtvPosition = (TextView) root.findViewById(R.id.txtvPosition); butPlay = (ImageButton) root.findViewById(R.id.butPlay); txtvStatus = (TextView) root.findViewById(R.id.txtvStatus); - + layoutInfo.setOnClickListener(new OnClickListener() { @Override @@ -73,7 +73,12 @@ public class ExternalPlayerFragment extends SherlockFragment { @Override public void onActivityCreated(Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); - controller = new PlaybackController(getActivity()) { + controller = setupPlaybackController(); + butPlay.setOnClickListener(controller.newOnPlayButtonClickListener()); + } + + private PlaybackController setupPlaybackController() { + return new PlaybackController(getActivity()) { @Override public void setupGUI() { @@ -150,9 +155,14 @@ public class ExternalPlayerFragment extends SherlockFragment { if (fragmentLayout != null) { fragmentLayout.setVisibility(View.GONE); } + controller = setupPlaybackController(); + if (butPlay != null) { + butPlay.setOnClickListener(controller + .newOnPlayButtonClickListener()); + } + } }; - butPlay.setOnClickListener(controller.newOnPlayButtonClickListener()); } @Override |