summaryrefslogtreecommitdiffstats
path: root/src/com
diff options
context:
space:
mode:
authorChia-chi Yeh <chiachi@android.com>2011-07-15 11:36:52 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2011-07-15 11:36:52 -0700
commit9ed54442121f3ed6597d8c63270f5405821264ec (patch)
tree2d141689b5553e8fd55cddb02419c4e73a60edf4 /src/com
parent3dba8d527fd24a69f7becd62e7d4cb7b40185b1e (diff)
parentd501b5c963c0cbcc9c666f502229599464eaf3fd (diff)
downloadpackages_apps_settings-9ed54442121f3ed6597d8c63270f5405821264ec.zip
packages_apps_settings-9ed54442121f3ed6597d8c63270f5405821264ec.tar.gz
packages_apps_settings-9ed54442121f3ed6597d8c63270f5405821264ec.tar.bz2
Merge "VpnSettings: bind OnPreferenceClickListener later."
Diffstat (limited to 'src/com')
-rw-r--r--src/com/android/settings/vpn2/VpnSettings.java11
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.