From 011a7e2ec6b0face64bcc8841ff5b8d3ad3db44f Mon Sep 17 00:00:00 2001 From: Scott Jackson Date: Thu, 23 May 2013 23:30:45 -0700 Subject: Fix if you jump straight to chat tab --- subsonic-android/AndroidManifest.xml | 2 +- .../src/github/daneren2005/dsub/activity/SubsonicActivity.java | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) (limited to 'subsonic-android') diff --git a/subsonic-android/AndroidManifest.xml b/subsonic-android/AndroidManifest.xml index c9bf87b4..104feaea 100644 --- a/subsonic-android/AndroidManifest.xml +++ b/subsonic-android/AndroidManifest.xml @@ -2,7 +2,7 @@ diff --git a/subsonic-android/src/github/daneren2005/dsub/activity/SubsonicActivity.java b/subsonic-android/src/github/daneren2005/dsub/activity/SubsonicActivity.java index 15b8421f..cb4cac6f 100644 --- a/subsonic-android/src/github/daneren2005/dsub/activity/SubsonicActivity.java +++ b/subsonic-android/src/github/daneren2005/dsub/activity/SubsonicActivity.java @@ -404,7 +404,14 @@ public class SubsonicActivity extends SherlockFragmentActivity implements OnItem SubsonicFragment frag = (SubsonicFragment) Fragment.instantiate(activity, tabInfo.fragmentClass.getName(), tabInfo.args); List fragStack = new ArrayList(); fragStack.add(frag); - frags.add(i, fragStack); + while(i > frags.size()) { + frags.add(null); + } + if(i == frags.size()) { + frags.add(i, fragStack); + } else { + frags.set(i, fragStack); + } if(currentFragment == null) { currentFragment = frag; currentFragment.setPrimaryFragment(true); -- cgit v1.2.3