am 6c1ac291
: am dc543d28
: Fix the issue WiFi UI IP settings lost when change slider state before save IP settings
Merge commit '6c1ac291d9f8adacc5dd3b8b5f08a11dced53ecb' * commit '6c1ac291d9f8adacc5dd3b8b5f08a11dced53ecb': Fix the issue WiFi UI IP settings lost when change slider state before save IP settings
This commit is contained in:
@@ -64,6 +64,7 @@ public class AdvancedSettings extends PreferenceActivity
|
|||||||
addPreferencesFromResource(R.xml.wifi_advanced_settings);
|
addPreferencesFromResource(R.xml.wifi_advanced_settings);
|
||||||
|
|
||||||
mUseStaticIpCheckBox = (CheckBoxPreference) findPreference(KEY_USE_STATIC_IP);
|
mUseStaticIpCheckBox = (CheckBoxPreference) findPreference(KEY_USE_STATIC_IP);
|
||||||
|
mUseStaticIpCheckBox.setOnPreferenceChangeListener(this);
|
||||||
|
|
||||||
for (int i = 0; i < mPreferenceKeys.length; i++) {
|
for (int i = 0; i < mPreferenceKeys.length; i++) {
|
||||||
Preference preference = findPreference(mPreferenceKeys[i]);
|
Preference preference = findPreference(mPreferenceKeys[i]);
|
||||||
@@ -167,7 +168,16 @@ public class AdvancedSettings extends PreferenceActivity
|
|||||||
Toast.LENGTH_SHORT).show();
|
Toast.LENGTH_SHORT).show();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} else if (key.equals(KEY_USE_STATIC_IP)) {
|
||||||
|
boolean value = ((Boolean) newValue).booleanValue();
|
||||||
|
|
||||||
|
try {
|
||||||
|
Settings.System.putInt(getContentResolver(),
|
||||||
|
Settings.System.WIFI_USE_STATIC_IP, value ? 1 : 0);
|
||||||
|
} catch (NumberFormatException e) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
String value = (String) newValue;
|
String value = (String) newValue;
|
||||||
|
|
||||||
@@ -177,6 +187,12 @@ public class AdvancedSettings extends PreferenceActivity
|
|||||||
}
|
}
|
||||||
|
|
||||||
preference.setSummary(value);
|
preference.setSummary(value);
|
||||||
|
for (int i = 0; i < mSettingNames.length; i++) {
|
||||||
|
if (key.equals(mPreferenceKeys[i])) {
|
||||||
|
Settings.System.putString(getContentResolver(), mSettingNames[i], value);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
Reference in New Issue
Block a user