diff options
author | daneren2005 <daneren2005@gmail.com> | 2013-10-16 13:46:11 -0700 |
---|---|---|
committer | daneren2005 <daneren2005@gmail.com> | 2013-10-16 13:46:11 -0700 |
commit | bbce6f8b1c15cb913d4890fe2764a440d741f807 (patch) | |
tree | d790e516874d20161126d1690733db3b420f3bdd | |
parent | 4810c17db64082a078739d8201cc5f87faac0c27 (diff) | |
download | dsub-bbce6f8b1c15cb913d4890fe2764a440d741f807.tar.gz dsub-bbce6f8b1c15cb913d4890fe2764a440d741f807.tar.bz2 dsub-bbce6f8b1c15cb913d4890fe2764a440d741f807.zip |
Fix for tabCount somehow being == 0 in a pager restore method
-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 {
|