aboutsummaryrefslogtreecommitdiff
path: root/subsonic-android/src/github/daneren2005/dsub/fragments/SearchFragment.java
diff options
context:
space:
mode:
Diffstat (limited to 'subsonic-android/src/github/daneren2005/dsub/fragments/SearchFragment.java')
-rw-r--r--subsonic-android/src/github/daneren2005/dsub/fragments/SearchFragment.java21
1 files changed, 13 insertions, 8 deletions
diff --git a/subsonic-android/src/github/daneren2005/dsub/fragments/SearchFragment.java b/subsonic-android/src/github/daneren2005/dsub/fragments/SearchFragment.java
index 9821dbf2..c2fc289d 100644
--- a/subsonic-android/src/github/daneren2005/dsub/fragments/SearchFragment.java
+++ b/subsonic-android/src/github/daneren2005/dsub/fragments/SearchFragment.java
@@ -282,13 +282,18 @@ public class SearchFragment extends SubsonicFragment {
}
private void onAlbumSelected(MusicDirectory.Entry album, boolean autoplay) {
- SubsonicFragment parentFragment = new SelectDirectoryFragment();
- Bundle args = new Bundle();
- args.putString(Constants.INTENT_EXTRA_NAME_ID, album.getParent());
- args.putString(Constants.INTENT_EXTRA_NAME_NAME, album.getArtist());
- parentFragment.setArguments(args);
-
- replaceFragment(parentFragment, R.id.search_layout);
+ int id = R.id.search_layout;
+ Bundle args;
+ if(album.getParent() != null) {
+ SubsonicFragment parentFragment = new SelectDirectoryFragment();
+ args = new Bundle();
+ args.putString(Constants.INTENT_EXTRA_NAME_ID, album.getParent());
+ args.putString(Constants.INTENT_EXTRA_NAME_NAME, album.getArtist());
+ parentFragment.setArguments(args);
+
+ replaceFragment(parentFragment, R.id.search_layout);
+ id = R.id.select_album_layout;
+ }
SubsonicFragment fragment = new SelectDirectoryFragment();
args = new Bundle();
@@ -296,7 +301,7 @@ public class SearchFragment extends SubsonicFragment {
args.putString(Constants.INTENT_EXTRA_NAME_NAME, album.getTitle());
fragment.setArguments(args);
- replaceFragment(fragment, R.id.select_album_layout);
+ replaceFragment(fragment, id);
}
private void onSongSelected(MusicDirectory.Entry song, boolean save, boolean append, boolean autoplay, boolean playNext) {