diff options
author | Chia-chi Yeh <chiachi@android.com> | 2011-07-15 11:36:52 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2011-07-15 11:36:52 -0700 |
commit | 9ed54442121f3ed6597d8c63270f5405821264ec (patch) | |
tree | 2d141689b5553e8fd55cddb02419c4e73a60edf4 | |
parent | 3dba8d527fd24a69f7becd62e7d4cb7b40185b1e (diff) | |
parent | d501b5c963c0cbcc9c666f502229599464eaf3fd (diff) | |
download | packages_apps_settings-9ed54442121f3ed6597d8c63270f5405821264ec.zip packages_apps_settings-9ed54442121f3ed6597d8c63270f5405821264ec.tar.gz packages_apps_settings-9ed54442121f3ed6597d8c63270f5405821264ec.tar.bz2 |
Merge "VpnSettings: bind OnPreferenceClickListener later."
-rw-r--r-- | src/com/android/settings/vpn2/VpnSettings.java | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/com/android/settings/vpn2/VpnSettings.java b/src/com/android/settings/vpn2/VpnSettings.java index 082b95f..4dbb6bd 100644 --- a/src/com/android/settings/vpn2/VpnSettings.java +++ b/src/com/android/settings/vpn2/VpnSettings.java @@ -73,9 +73,7 @@ public class VpnSettings extends SettingsPreferenceFragment implements public void onCreate(Bundle savedState) { super.onCreate(savedState); addPreferencesFromResource(R.xml.vpn_settings2); - PreferenceGroup group = getPreferenceScreen(); - group.setOrderingAsAdded(false); - group.findPreference("add_network").setOnPreferenceClickListener(this); + getPreferenceScreen().setOrderingAsAdded(false); if (savedState != null) { VpnProfile profile = VpnProfile.decode(savedState.getString("VpnKey"), @@ -124,6 +122,7 @@ public class VpnSettings extends SettingsPreferenceFragment implements // safely cache profiles in the memory. if (mPreferences == null) { mPreferences = new HashMap<String, VpnPreference>(); + PreferenceGroup group = getPreferenceScreen(); String[] keys = mKeyStore.saw(Credentials.VPN); if (keys != null && keys.length > 0) { @@ -138,13 +137,11 @@ public class VpnSettings extends SettingsPreferenceFragment implements } else { VpnPreference preference = new VpnPreference(context, profile); mPreferences.put(key, preference); + group.addPreference(preference); } } } - } - PreferenceGroup group = getPreferenceScreen(); - for (VpnPreference preference : mPreferences.values()) { - group.addPreference(preference); + group.findPreference("add_network").setOnPreferenceClickListener(this); } // Show the dialog if there is one. |