diff options
Diffstat (limited to 'subsonic-android/src/github/daneren2005')
-rw-r--r-- | subsonic-android/src/github/daneren2005/dsub/fragments/SearchFragment.java | 21 | ||||
-rw-r--r-- | subsonic-android/src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java | 2 |
2 files changed, 14 insertions, 9 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) {
diff --git a/subsonic-android/src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java b/subsonic-android/src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java index 5ebbd7e9..084269ee 100644 --- a/subsonic-android/src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java +++ b/subsonic-android/src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java @@ -227,7 +227,7 @@ public class SelectDirectoryFragment extends SubsonicFragment implements Adapter if (position >= 0) {
MusicDirectory.Entry entry = (MusicDirectory.Entry) parent.getItemAtPosition(position);
if (entry.isDirectory()) {
- if(albumListType != null) {
+ if(albumListType != null && entry.getParent() != null) {
SubsonicFragment parentFragment = new SelectDirectoryFragment();
Bundle args = new Bundle();
args.putString(Constants.INTENT_EXTRA_NAME_ID, entry.getParent());
|