aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott Jackson <daneren2005@gmail.com>2012-09-14 20:51:27 -0700
committerScott Jackson <daneren2005@gmail.com>2012-09-14 20:51:27 -0700
commit5216400fcb830bdc45d3d4f76f3af60ca14771ac (patch)
treef585cfb60e7f9bfaa578dfb8e6109f12c7d8114b
parentd0e7ff24e162532daf90176f21059c06ae0f9e84 (diff)
downloaddsub-5216400fcb830bdc45d3d4f76f3af60ca14771ac.tar.gz
dsub-5216400fcb830bdc45d3d4f76f3af60ca14771ac.tar.bz2
dsub-5216400fcb830bdc45d3d4f76f3af60ca14771ac.zip
Fix for NullException on offline album viewing
-rw-r--r--subsonic-android/src/github/daneren2005/dsub/activity/SelectAlbumActivity.java12
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);