diff options
author | daniel oeh <daniel.oeh@gmail.com> | 2013-04-06 12:27:43 +0200 |
---|---|---|
committer | daniel oeh <daniel.oeh@gmail.com> | 2013-04-06 12:27:43 +0200 |
commit | 81797ba879d77f9add5de3ef30df28b3d0e01e4b (patch) | |
tree | 42aa874633b4dfa4fd108ad079f3d9b5f5a600d4 /src/de | |
parent | 90fb2b42bf5ce37666dc29f4d0f486657ce60ab0 (diff) | |
download | AntennaPod-81797ba879d77f9add5de3ef30df28b3d0e01e4b.zip |
Fixed nullpointerexception in AudioplayerActivity
Diffstat (limited to 'src/de')
-rw-r--r-- | src/de/danoeh/antennapod/activity/AudioplayerActivity.java | 9 |
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() |