aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorScott Jackson <daneren2005@gmail.com>2015-03-12 11:22:50 -0700
committerScott Jackson <daneren2005@gmail.com>2015-03-12 11:22:50 -0700
commit6e340110d8211de2dfc76edf72c3043869862503 (patch)
treec2a75951cf140f357e96d1cc198c46c7db38352b /src
parent04e68a81a3c734356cb1d4b801db17db1784ebb3 (diff)
downloaddsub-6e340110d8211de2dfc76edf72c3043869862503.tar.gz
dsub-6e340110d8211de2dfc76edf72c3043869862503.tar.bz2
dsub-6e340110d8211de2dfc76edf72c3043869862503.zip
Fix crash on selecting spinner if title is null
Diffstat (limited to 'src')
-rw-r--r--src/github/daneren2005/dsub/activity/SubsonicActivity.java13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/github/daneren2005/dsub/activity/SubsonicActivity.java b/src/github/daneren2005/dsub/activity/SubsonicActivity.java
index 20ff568f..dab46779 100644
--- a/src/github/daneren2005/dsub/activity/SubsonicActivity.java
+++ b/src/github/daneren2005/dsub/activity/SubsonicActivity.java
@@ -670,9 +670,18 @@ public class SubsonicActivity extends ActionBarActivity implements OnItemSelecte
if(backStack.size() > 0) {
spinnerAdapter.clear();
for(int i = 0; i < backStack.size(); i++) {
- spinnerAdapter.add(backStack.get(i).getTitle());
+ CharSequence title = backStack.get(i).getTitle();
+ if(title != null) {
+ spinnerAdapter.add(title);
+ } else {
+ spinnerAdapter.add("null");
+ }
+ }
+ if(currentFragment.getTitle() != null) {
+ spinnerAdapter.add(currentFragment.getTitle());
+ } else {
+ spinnerAdapter.add("null");
}
- spinnerAdapter.add(currentFragment.getTitle());
spinnerAdapter.notifyDataSetChanged();
actionBarSpinner.setSelection(spinnerAdapter.getCount() - 1);
getSupportActionBar().setDisplayShowCustomEnabled(true);