diff options
author | Scott Jackson <daneren2005@gmail.com> | 2015-01-16 13:00:23 -0800 |
---|---|---|
committer | Scott Jackson <daneren2005@gmail.com> | 2015-01-16 13:00:23 -0800 |
commit | 328cd16b9f5f084adc4e64a2744b2e424a2478fd (patch) | |
tree | 5f97f11901f30f520bc79f6324812447865f6004 | |
parent | 40a25a41f31a839c81c42fdd2f93c3df6e8304a1 (diff) | |
parent | 02e0f441bb908fe65d9a8849e1abf768a0b722dc (diff) | |
download | dsub-328cd16b9f5f084adc4e64a2744b2e424a2478fd.tar.gz dsub-328cd16b9f5f084adc4e64a2744b2e424a2478fd.tar.bz2 dsub-328cd16b9f5f084adc4e64a2744b2e424a2478fd.zip |
Merge branch 'master' into DLNA
-rw-r--r-- | src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java b/src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java index ba884503..805c0de0 100644 --- a/src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java +++ b/src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java @@ -334,12 +334,20 @@ public class SelectDirectoryFragment extends SubsonicFragment implements Adapter return;
}
entry = (Entry) entryList.getItemAtPosition(info.position);
- albumContext = false;
+ // When List has Grid embedded in header, this is called against the header as well
+ if(entry != null) {
+ albumContext = false;
+ }
} else {
entry = (Entry) albumList.getItemAtPosition(info.position);
albumContext = true;
}
+ // Don't try to display a context menu if error here
+ if(entry == null) {
+ return;
+ }
+
onCreateContextMenu(menu, view, menuInfo, entry);
if(!entry.isVideo() && !Util.isOffline(context) && (playlistId == null || !playlistOwner) && (podcastId == null || Util.isOffline(context) && podcastId != null)) {
menu.removeItem(R.id.song_menu_remove_playlist);
@@ -373,7 +381,7 @@ public class SelectDirectoryFragment extends SubsonicFragment implements Adapter Object selectedItem;
int headers = entryList.getHeaderViewsCount();
if(albumContext) {
- selectedItem = albums.get(info.position);
+ selectedItem = albumList.getItemAtPosition(info.position);
} else {
if(info.position == 0) {
return false;
|