diff options
-rw-r--r-- | src/github/daneren2005/dsub/activity/SubsonicActivity.java | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/github/daneren2005/dsub/activity/SubsonicActivity.java b/src/github/daneren2005/dsub/activity/SubsonicActivity.java index 98698d87..83f11ecd 100644 --- a/src/github/daneren2005/dsub/activity/SubsonicActivity.java +++ b/src/github/daneren2005/dsub/activity/SubsonicActivity.java @@ -754,11 +754,14 @@ public class SubsonicActivity extends ActionBarActivity implements OnItemSelecte frags.add(i, fragStack);
}
- currentPosition = savedInstanceState.getInt(Constants.MAIN_BACK_STACK_POSITION);
- List<SubsonicFragment> fragStack = frags.get(currentPosition);
- currentFragment = fragStack.get(fragStack.size() - 1);
- currentFragment.setPrimaryFragment(true);
- activity.supportInvalidateOptionsMenu();
+
+ if(tabCount > 0) {
+ currentPosition = savedInstanceState.getInt(Constants.MAIN_BACK_STACK_POSITION);
+ List<SubsonicFragment> fragStack = frags.get(currentPosition);
+ currentFragment = fragStack.get(fragStack.size() - 1);
+ currentFragment.setPrimaryFragment(true);
+ activity.supportInvalidateOptionsMenu();
+ }
}
private class TabInfo {
|