aboutsummaryrefslogtreecommitdiff
path: root/src/github
diff options
context:
space:
mode:
authorScott Jackson <daneren2005@gmail.com>2013-10-27 14:16:06 -0700
committerScott Jackson <daneren2005@gmail.com>2013-10-27 14:16:06 -0700
commit1beffd3861d94e07717317fe336032e64e5da2b4 (patch)
treef29c509d2626b266411d0c45888438629db898cb /src/github
parentfc6b17b5c3be344ce4ceda1e186f759e440c9c22 (diff)
downloaddsub-1beffd3861d94e07717317fe336032e64e5da2b4.tar.gz
dsub-1beffd3861d94e07717317fe336032e64e5da2b4.tar.bz2
dsub-1beffd3861d94e07717317fe336032e64e5da2b4.zip
Fix actionbar title not being saved on orientation change
Diffstat (limited to 'src/github')
-rw-r--r--src/github/daneren2005/dsub/fragments/SubsonicFragment.java14
-rw-r--r--src/github/daneren2005/dsub/util/Constants.java1
2 files changed, 15 insertions, 0 deletions
diff --git a/src/github/daneren2005/dsub/fragments/SubsonicFragment.java b/src/github/daneren2005/dsub/fragments/SubsonicFragment.java
index 1a55d1d0..7c293447 100644
--- a/src/github/daneren2005/dsub/fragments/SubsonicFragment.java
+++ b/src/github/daneren2005/dsub/fragments/SubsonicFragment.java
@@ -64,6 +64,7 @@ import github.daneren2005.dsub.util.SilentBackgroundTask;
import github.daneren2005.dsub.util.LoadingTask;
import github.daneren2005.dsub.util.Util;
import java.io.File;
+import java.io.Serializable;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
@@ -95,6 +96,19 @@ public class SubsonicFragment extends Fragment {
@Override
public void onCreate(Bundle bundle) {
super.onCreate(bundle);
+
+ if(bundle != null) {
+ String name = bundle.getString(Constants.FRAGMENT_NAME);
+ if(name != null) {
+ title = name;
+ }
+ }
+ }
+
+ @Override
+ public void onSaveInstanceState(Bundle outState) {
+ super.onSaveInstanceState(outState);
+ outState.putString(Constants.FRAGMENT_NAME, title.toString());
}
@Override
diff --git a/src/github/daneren2005/dsub/util/Constants.java b/src/github/daneren2005/dsub/util/Constants.java
index f01a9c48..1805b5c6 100644
--- a/src/github/daneren2005/dsub/util/Constants.java
+++ b/src/github/daneren2005/dsub/util/Constants.java
@@ -140,6 +140,7 @@ public final class Constants {
public static final String FRAGMENT_LIST = "fragmentList";
public static final String FRAGMENT_LIST2 = "fragmentList2";
public static final String FRAGMENT_DOWNLOAD_FLIPPER = "fragmentDownloadFlipper";
+ public static final String FRAGMENT_NAME = "fragmentName";
// Name of the preferences file.
public static final String PREFERENCES_FILE_NAME = "github.daneren2005.dsub_preferences";