aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--subsonic-android/src/github/daneren2005/dsub/activity/SubsonicActivity.java16
-rw-r--r--subsonic-android/src/github/daneren2005/dsub/fragments/SelectArtistFragment.java6
-rw-r--r--subsonic-android/src/github/daneren2005/dsub/fragments/SelectPlaylistFragment.java6
3 files changed, 19 insertions, 9 deletions
diff --git a/subsonic-android/src/github/daneren2005/dsub/activity/SubsonicActivity.java b/subsonic-android/src/github/daneren2005/dsub/activity/SubsonicActivity.java
index 0c8d130a..80f4ffc0 100644
--- a/subsonic-android/src/github/daneren2005/dsub/activity/SubsonicActivity.java
+++ b/subsonic-android/src/github/daneren2005/dsub/activity/SubsonicActivity.java
@@ -416,7 +416,7 @@ public class SubsonicActivity extends SherlockFragmentActivity implements OnItem
} else {
frags.set(i, fragStack);
}
- if(currentFragment == null) {
+ if(currentFragment == null || currentPosition == i) {
currentFragment = frag;
currentFragment.setPrimaryFragment(true);
}
@@ -465,13 +465,15 @@ public class SubsonicActivity extends SherlockFragmentActivity implements OnItem
if(currentFragment != null) {
currentFragment.setPrimaryFragment(false);
}
- List<SubsonicFragment> fragStack = frags.get(position);
- currentFragment = fragStack.get(fragStack.size() - 1);
- if(currentFragment != null) {
- currentFragment.setPrimaryFragment(true);
+ if(position <= frags.size()) {
+ List<SubsonicFragment> fragStack = frags.get(position);
+ currentFragment = fragStack.get(fragStack.size() - 1);
+ if(currentFragment != null) {
+ currentFragment.setPrimaryFragment(true);
+ }
+ activity.invalidateOptionsMenu();
+ recreateSpinner();
}
- activity.invalidateOptionsMenu();
- recreateSpinner();
}
public void addTab(CharSequence title, Class fragmentClass, Bundle args) {
diff --git a/subsonic-android/src/github/daneren2005/dsub/fragments/SelectArtistFragment.java b/subsonic-android/src/github/daneren2005/dsub/fragments/SelectArtistFragment.java
index 8485f342..0a35233e 100644
--- a/subsonic-android/src/github/daneren2005/dsub/fragments/SelectArtistFragment.java
+++ b/subsonic-android/src/github/daneren2005/dsub/fragments/SelectArtistFragment.java
@@ -58,7 +58,11 @@ public class SelectArtistFragment extends SubsonicFragment implements AdapterVie
folderButton = folderButtonParent.findViewById(R.id.select_artist_folder);
registerForContextMenu(artistList);
- invalidated = true;
+ if(!primaryFragment) {
+ invalidated = true;
+ } else {
+ refresh(false);
+ }
return rootView;
}
diff --git a/subsonic-android/src/github/daneren2005/dsub/fragments/SelectPlaylistFragment.java b/subsonic-android/src/github/daneren2005/dsub/fragments/SelectPlaylistFragment.java
index 1369eef0..aa0ffcf8 100644
--- a/subsonic-android/src/github/daneren2005/dsub/fragments/SelectPlaylistFragment.java
+++ b/subsonic-android/src/github/daneren2005/dsub/fragments/SelectPlaylistFragment.java
@@ -51,7 +51,11 @@ public class SelectPlaylistFragment extends SubsonicFragment implements AdapterV
emptyTextView = rootView.findViewById(R.id.select_playlist_empty);
list.setOnItemClickListener(this);
registerForContextMenu(list);
- invalidated = true;
+ if(!primaryFragment) {
+ invalidated = true;
+ } else {
+ refresh(false);
+ }
return rootView;
}