diff options
author | cretin45 <cretin45@gmail.com> | 2015-01-23 11:37:23 -0800 |
---|---|---|
committer | cretin45 <cretin45@gmail.com> | 2015-01-23 11:37:23 -0800 |
commit | 61a331f403816183d7618f85828c26d25fd48b90 (patch) | |
tree | 457eb0e9b7f2353f658fb4d7a862e53a11efa50a /src/com/cyanogenmod/setupwizard/setup/LocationSettingsPage.java | |
parent | 30af327616c2c591d0f54982688915edfaf23742 (diff) | |
download | packages_apps_SetupWizard-61a331f403816183d7618f85828c26d25fd48b90.zip packages_apps_SetupWizard-61a331f403816183d7618f85828c26d25fd48b90.tar.gz packages_apps_SetupWizard-61a331f403816183d7618f85828c26d25fd48b90.tar.bz2 |
SetupWizard: Better handle next and previous actions
Change-Id: I239269d9313594b1d37ce3468e0c095c851946c6
Diffstat (limited to 'src/com/cyanogenmod/setupwizard/setup/LocationSettingsPage.java')
-rw-r--r-- | src/com/cyanogenmod/setupwizard/setup/LocationSettingsPage.java | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/com/cyanogenmod/setupwizard/setup/LocationSettingsPage.java b/src/com/cyanogenmod/setupwizard/setup/LocationSettingsPage.java index ff87054..0264599 100644 --- a/src/com/cyanogenmod/setupwizard/setup/LocationSettingsPage.java +++ b/src/com/cyanogenmod/setupwizard/setup/LocationSettingsPage.java @@ -17,6 +17,7 @@ package com.cyanogenmod.setupwizard.setup; import android.app.Fragment; +import android.app.FragmentManager; import android.content.ContentQueryMap; import android.content.ContentResolver; import android.content.Context; @@ -42,12 +43,15 @@ public class LocationSettingsPage extends SetupPage { } @Override - public Fragment getFragment() { - Bundle args = new Bundle(); - args.putString(Page.KEY_PAGE_ARGUMENT, getKey()); - - LocationSettingsFragment fragment = new LocationSettingsFragment(); - fragment.setArguments(args); + public Fragment getFragment(FragmentManager fragmentManager, int action) { + Fragment fragment = fragmentManager.findFragmentByTag(getKey()); + if (fragment == null) { + Bundle args = new Bundle(); + args.putString(Page.KEY_PAGE_ARGUMENT, getKey()); + args.putInt(Page.KEY_PAGE_ACTION, action); + fragment = new LocationSettingsFragment(); + fragment.setArguments(args); + } return fragment; } |