diff options
author | Scott Jackson <daneren2005@gmail.com> | 2013-05-30 21:30:15 -0700 |
---|---|---|
committer | Scott Jackson <daneren2005@gmail.com> | 2013-05-30 21:30:15 -0700 |
commit | 4cb0e73aaf59f46b93657d94ee19d9270c9db0f7 (patch) | |
tree | 700bd1db5a071fb5d69628bd97c636eb5aeb3b22 /subsonic-android | |
parent | 0284a51a070a563b2cbdd26fffcd75ee64a78ccb (diff) | |
download | dsub-4cb0e73aaf59f46b93657d94ee19d9270c9db0f7.tar.gz dsub-4cb0e73aaf59f46b93657d94ee19d9270c9db0f7.tar.bz2 dsub-4cb0e73aaf59f46b93657d94ee19d9270c9db0f7.zip |
On PagerAdapter.invalidate(), clear fragment stacks
Diffstat (limited to 'subsonic-android')
-rw-r--r-- | subsonic-android/src/github/daneren2005/dsub/activity/SubsonicActivity.java | 12 |
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) {
|