diff options
author | Scott Jackson <daneren2005@gmail.com> | 2013-07-02 07:09:26 -0700 |
---|---|---|
committer | Scott Jackson <daneren2005@gmail.com> | 2013-07-02 07:09:26 -0700 |
commit | 813b308a36e81b0ade03c076c4e59e473ba7d3c6 (patch) | |
tree | 1832627437b6a8715ef6cc5c9391d1120efce00c /subsonic-android/src | |
parent | 2099a03e4ec57504b5d5ab5dd8b9a2f90d62ca19 (diff) | |
download | dsub-813b308a36e81b0ade03c076c4e59e473ba7d3c6.tar.gz dsub-813b308a36e81b0ade03c076c4e59e473ba7d3c6.tar.bz2 dsub-813b308a36e81b0ade03c076c4e59e473ba7d3c6.zip |
Fix orientation change with new id system
Diffstat (limited to 'subsonic-android/src')
-rw-r--r-- | subsonic-android/src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java | 12 | ||||
-rw-r--r-- | subsonic-android/src/github/daneren2005/dsub/util/Constants.java | 1 |
2 files changed, 13 insertions, 0 deletions
diff --git a/subsonic-android/src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java b/subsonic-android/src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java index 1626768e..4d9ebafd 100644 --- a/subsonic-android/src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java +++ b/subsonic-android/src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java @@ -71,6 +71,18 @@ public class SelectDirectoryFragment extends SubsonicFragment implements Adapter @Override
public void onCreate(Bundle bundle) {
super.onCreate(bundle);
+ if(bundle != null) {
+ int tmp = bundle.getInt(Constants.FRAGMENT_ID, -1);
+ if(tmp > 0) {
+ rootId = tmp;
+ }
+ }
+ }
+
+ @Override
+ public void onSaveInstanceState(Bundle outState) {
+ super.onSaveInstanceState(outState);
+ outState.putInt(Constants.FRAGMENT_ID, rootId);
}
@Override
diff --git a/subsonic-android/src/github/daneren2005/dsub/util/Constants.java b/subsonic-android/src/github/daneren2005/dsub/util/Constants.java index a5168a9a..550749b9 100644 --- a/subsonic-android/src/github/daneren2005/dsub/util/Constants.java +++ b/subsonic-android/src/github/daneren2005/dsub/util/Constants.java @@ -129,6 +129,7 @@ public final class Constants { public static final String MAIN_BACK_STACK_SIZE = "backStackIdsSize"; public static final String MAIN_BACK_STACK_TABS = "backStackTabs"; public static final String MAIN_BACK_STACK_POSITION = "backStackPosition"; + public static final String FRAGMENT_ID = "fragmentId"; // Name of the preferences file. public static final String PREFERENCES_FILE_NAME = "github.daneren2005.dsub_preferences"; |