diff options
Diffstat (limited to 'src/github')
-rw-r--r-- | src/github/daneren2005/dsub/activity/SubsonicActivity.java | 10 | ||||
-rw-r--r-- | src/github/daneren2005/dsub/fragments/SubsonicFragment.java | 4 |
2 files changed, 10 insertions, 4 deletions
diff --git a/src/github/daneren2005/dsub/activity/SubsonicActivity.java b/src/github/daneren2005/dsub/activity/SubsonicActivity.java index 2865ef8f..4d60dd77 100644 --- a/src/github/daneren2005/dsub/activity/SubsonicActivity.java +++ b/src/github/daneren2005/dsub/activity/SubsonicActivity.java @@ -372,8 +372,10 @@ public class SubsonicActivity extends ActionBarActivity implements OnItemSelecte @Override
public void setTitle(CharSequence title) {
- getSupportActionBar().setTitle(title);
- recreateSpinner();
+ if(!title.equals(getSupportActionBar().getTitle())) {
+ getSupportActionBar().setTitle(title);
+ recreateSpinner();
+ }
}
public void setSubtitle(CharSequence title) {
getSupportActionBar().setSubtitle(title);
@@ -653,6 +655,10 @@ public class SubsonicActivity extends ActionBarActivity implements OnItemSelecte }
protected void recreateSpinner() {
+ if(currentFragment.getTitle() == null) {
+ return;
+ }
+
if(backStack.size() > 0) {
spinnerAdapter.clear();
for(int i = 0; i < backStack.size(); i++) {
diff --git a/src/github/daneren2005/dsub/fragments/SubsonicFragment.java b/src/github/daneren2005/dsub/fragments/SubsonicFragment.java index cf6f78b0..fe1153c0 100644 --- a/src/github/daneren2005/dsub/fragments/SubsonicFragment.java +++ b/src/github/daneren2005/dsub/fragments/SubsonicFragment.java @@ -96,7 +96,7 @@ public class SubsonicFragment extends Fragment implements SwipeRefreshLayout.OnR private int tag;
protected SubsonicActivity context;
- protected CharSequence title = "DSub";
+ protected CharSequence title = null;
protected CharSequence subtitle = null;
protected View rootView;
protected boolean primaryFragment = false;
@@ -420,7 +420,7 @@ public class SubsonicFragment extends Fragment implements SwipeRefreshLayout.OnR public void setPrimaryFragment(boolean primary) {
primaryFragment = primary;
if(primary) {
- if(context != null) {
+ if(context != null && title != null) {
context.setTitle(title);
context.setSubtitle(subtitle);
}
|