aboutsummaryrefslogtreecommitdiff
path: root/subsonic-android/src/github
diff options
context:
space:
mode:
authorScott Jackson <daneren2005@gmail.com>2013-05-30 21:30:15 -0700
committerScott Jackson <daneren2005@gmail.com>2013-05-30 21:30:15 -0700
commit4cb0e73aaf59f46b93657d94ee19d9270c9db0f7 (patch)
tree700bd1db5a071fb5d69628bd97c636eb5aeb3b22 /subsonic-android/src/github
parent0284a51a070a563b2cbdd26fffcd75ee64a78ccb (diff)
downloaddsub-4cb0e73aaf59f46b93657d94ee19d9270c9db0f7.tar.gz
dsub-4cb0e73aaf59f46b93657d94ee19d9270c9db0f7.tar.bz2
dsub-4cb0e73aaf59f46b93657d94ee19d9270c9db0f7.zip
On PagerAdapter.invalidate(), clear fragment stacks
Diffstat (limited to 'subsonic-android/src/github')
-rw-r--r--subsonic-android/src/github/daneren2005/dsub/activity/SubsonicActivity.java12
1 files changed, 10 insertions, 2 deletions
diff --git a/subsonic-android/src/github/daneren2005/dsub/activity/SubsonicActivity.java b/subsonic-android/src/github/daneren2005/dsub/activity/SubsonicActivity.java
index 2a06b5c6..d8158f7d 100644
--- a/subsonic-android/src/github/daneren2005/dsub/activity/SubsonicActivity.java
+++ b/subsonic-android/src/github/daneren2005/dsub/activity/SubsonicActivity.java
@@ -573,11 +573,19 @@ public class SubsonicActivity extends SherlockFragmentActivity implements OnItem
}
public void invalidate() {
+ FragmentTransaction trans = getSupportFragmentManager().beginTransaction();
for (int i = 0; i < frags.size(); i++) {
- List fragStack = (List)frags.get(i);
- SubsonicFragment frag = (SubsonicFragment)fragStack.get(fragStack.size() - 1);
+ List<SubsonicFragment> fragStack = frags.get(i);
+
+ for(int j = fragStack.size() - 1; j > 0; j--) {
+ SubsonicFragment oldFrag = fragStack.remove(j);
+ trans.remove((Fragment)oldFrag);
+ }
+
+ SubsonicFragment frag = (SubsonicFragment)fragStack.get(0);
frag.invalidate();
}
+ trans.commit();
}
public void onSaveInstanceState(Bundle savedInstanceState) {