summaryrefslogtreecommitdiffstats
path: root/src/com/android/settings/SettingsPreferenceFragment.java
diff options
context:
space:
mode:
authorAmith Yamasani <yamasani@google.com>2010-11-12 08:51:01 -0800
committerAmith Yamasani <yamasani@google.com>2010-11-12 10:37:20 -0800
commit928e78acea580b2dd9f4d5b8207ec50ef9fc258d (patch)
tree3bf21a3d6caadc03843a668ce22fe921ee6fb679 /src/com/android/settings/SettingsPreferenceFragment.java
parent59a48604b5a803fbec6857e07f9fa1adbc6b8bb4 (diff)
downloadpackages_apps_Settings-928e78acea580b2dd9f4d5b8207ec50ef9fc258d.tar.gz
packages_apps_Settings-928e78acea580b2dd9f4d5b8207ec50ef9fc258d.tar.bz2
packages_apps_Settings-928e78acea580b2dd9f4d5b8207ec50ef9fc258d.zip
Fix VPN settings flow.
Bug: 3053019
Diffstat (limited to 'src/com/android/settings/SettingsPreferenceFragment.java')
-rw-r--r--src/com/android/settings/SettingsPreferenceFragment.java43
1 files changed, 2 insertions, 41 deletions
diff --git a/src/com/android/settings/SettingsPreferenceFragment.java b/src/com/android/settings/SettingsPreferenceFragment.java
index 41ff87f0c..3c771f592 100644
--- a/src/com/android/settings/SettingsPreferenceFragment.java
+++ b/src/com/android/settings/SettingsPreferenceFragment.java
@@ -64,49 +64,11 @@ public class SettingsPreferenceFragment extends PreferenceFragment
private Button mNextButton;
@Override
- public void onResume() {
- super.onResume();
-
- final Fragment f = getTargetFragment();
- final int requestCode = getTargetRequestCode();
-
- // TargetFragment becomes invalid when this object is resumed. Notify it to
- // FragmentManager. Without this code, FragmentManager wrongly take the TargetFragment
- // as live, and throws IllegalStateException.
- setTargetFragment(null, -1);
-
- if (f != null && (f instanceof SettingsPreferenceFragment)) {
- final SettingsPreferenceFragment spf = (SettingsPreferenceFragment)f;
- final int resultCode = spf.getResultCode();
- final Intent resultData = spf.getResultData();
- onActivityResult(requestCode, resultCode, resultData);
- }
- }
-
- @Override
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
setupButtonBar();
}
- public final void setResult(int resultCode) {
- mResultCode = resultCode;
- mResultData = null;
- }
-
- public final void setResult(int resultCode, Intent data) {
- mResultCode = resultCode;
- mResultData = data;
- }
-
- public final int getResultCode() {
- return mResultCode;
- }
-
- public final Intent getResultData() {
- return mResultData;
- }
-
/*
* The name is intentionally made different from Activity#finish(), so that
* users won't misunderstand its meaning.
@@ -196,9 +158,8 @@ public class SettingsPreferenceFragment extends PreferenceFragment
Fragment caller, String fragmentClass, int requestCode, Bundle extras) {
if (getActivity() instanceof PreferenceActivity) {
PreferenceActivity preferenceActivity = (PreferenceActivity)getActivity();
- Fragment f = Fragment.instantiate(getActivity(), fragmentClass, extras);
- caller.setTargetFragment(f, requestCode);
- preferenceActivity.switchToHeader(fragmentClass, extras);
+ preferenceActivity.startPreferencePanel(fragmentClass, extras, 0, null, caller,
+ requestCode);
return true;
} else {
Log.w(TAG, "Parent isn't PreferenceActivity, thus there's no way to launch the "