diff options
author | Scott Jackson <daneren2005@gmail.com> | 2012-09-14 20:51:27 -0700 |
---|---|---|
committer | Scott Jackson <daneren2005@gmail.com> | 2012-09-14 20:51:27 -0700 |
commit | 5216400fcb830bdc45d3d4f76f3af60ca14771ac (patch) | |
tree | f585cfb60e7f9bfaa578dfb8e6109f12c7d8114b /subsonic-android/src/github | |
parent | d0e7ff24e162532daf90176f21059c06ae0f9e84 (diff) | |
download | dsub-5216400fcb830bdc45d3d4f76f3af60ca14771ac.tar.gz dsub-5216400fcb830bdc45d3d4f76f3af60ca14771ac.tar.bz2 dsub-5216400fcb830bdc45d3d4f76f3af60ca14771ac.zip |
Fix for NullException on offline album viewing
Diffstat (limited to 'subsonic-android/src/github')
-rw-r--r-- | subsonic-android/src/github/daneren2005/dsub/activity/SelectAlbumActivity.java | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/subsonic-android/src/github/daneren2005/dsub/activity/SelectAlbumActivity.java b/subsonic-android/src/github/daneren2005/dsub/activity/SelectAlbumActivity.java index 9d1936ab..b0c47a5e 100644 --- a/subsonic-android/src/github/daneren2005/dsub/activity/SelectAlbumActivity.java +++ b/subsonic-android/src/github/daneren2005/dsub/activity/SelectAlbumActivity.java @@ -56,6 +56,7 @@ public class SelectAlbumActivity extends SubsonicTabActivity { private ListView entryList; private View footer; private View emptyView; + private boolean hideButtons = false; private com.actionbarsherlock.view.MenuItem selectAll; private com.actionbarsherlock.view.MenuItem cache; private com.actionbarsherlock.view.MenuItem delete; @@ -122,6 +123,13 @@ public class SelectAlbumActivity extends SubsonicTabActivity { cache = menu.findItem(R.id.menu_cache); delete = menu.findItem(R.id.menu_delete); playLast = menu.findItem(R.id.menu_play_last); + if(hideButtons) { + selectAll.setVisible(false); + cache.setVisible(false); + delete.setVisible(false); + playLast.setVisible(false); + hideButtons = false; + } return true; } @@ -505,11 +513,13 @@ public class SelectAlbumActivity extends SubsonicTabActivity { if (songCount > 0) { getImageLoader().loadImage(getSupportActionBar(), entries.get(0)); entryList.addFooterView(footer); - } else { + } else if(selectAll != null) { selectAll.setVisible(false); cache.setVisible(false); delete.setVisible(false); playLast.setVisible(false); + } else { + hideButtons = true; } emptyView.setVisibility(entries.isEmpty() ? View.VISIBLE : View.GONE); |