summaryrefslogtreecommitdiff
path: root/src/de
diff options
context:
space:
mode:
authordaniel oeh <daniel.oeh@gmail.com>2013-04-06 12:27:43 +0200
committerdaniel oeh <daniel.oeh@gmail.com>2013-04-06 12:27:43 +0200
commit81797ba879d77f9add5de3ef30df28b3d0e01e4b (patch)
tree42aa874633b4dfa4fd108ad079f3d9b5f5a600d4 /src/de
parent90fb2b42bf5ce37666dc29f4d0f486657ce60ab0 (diff)
downloadAntennaPod-81797ba879d77f9add5de3ef30df28b3d0e01e4b.zip
Fixed nullpointerexception in AudioplayerActivity
Diffstat (limited to 'src/de')
-rw-r--r--src/de/danoeh/antennapod/activity/AudioplayerActivity.java9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/de/danoeh/antennapod/activity/AudioplayerActivity.java b/src/de/danoeh/antennapod/activity/AudioplayerActivity.java
index f88e45305..673fb62f1 100644
--- a/src/de/danoeh/antennapod/activity/AudioplayerActivity.java
+++ b/src/de/danoeh/antennapod/activity/AudioplayerActivity.java
@@ -110,6 +110,9 @@ public class AudioplayerActivity extends MediaplayerActivity {
super.onCreate(savedInstanceState);
getSupportActionBar().setDisplayShowTitleEnabled(false);
detachedFragments = new Fragment[NUM_CONTENT_FRAGMENTS];
+ if (savedInstanceState != null) {
+ restoreSavedInstanceState(savedInstanceState);
+ }
}
@Override
@@ -131,6 +134,10 @@ public class AudioplayerActivity extends MediaplayerActivity {
@Override
protected void onRestoreInstanceState(Bundle savedInstanceState) {
super.onRestoreInstanceState(savedInstanceState);
+ restoreSavedInstanceState(savedInstanceState);
+ }
+
+ private void restoreSavedInstanceState(Bundle savedInstanceState) {
if (AppConfig.DEBUG)
Log.d(TAG, "Restoring instance state");
if (savedInstanceState != null) {
@@ -199,7 +206,7 @@ public class AudioplayerActivity extends MediaplayerActivity {
private void switchToFragment(int pos) {
if (AppConfig.DEBUG)
Log.d(TAG, "Switching contentView to position " + pos);
- if (currentlyShownPosition != pos) {
+ if (currentlyShownPosition != pos && controller != null) {
Playable media = controller.getMedia();
if (media != null) {
FragmentTransaction ft = getSupportFragmentManager()