settings: PremiumSingleChoiceSetting: Fix bug in getting/setting value.
This commit is contained in:
parent
2d47113d1d
commit
81461e8c83
@ -35,10 +35,7 @@ public final class PremiumSingleChoiceSetting extends SettingsItem {
|
||||
}
|
||||
|
||||
public int getSelectedValue() {
|
||||
if (getSetting() == null) {
|
||||
return 0;
|
||||
}
|
||||
return mPreferences.getInt(getSetting().getKey(), 0);
|
||||
return mPreferences.getInt(getKey(), mDefaultValue);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -49,9 +46,6 @@ public final class PremiumSingleChoiceSetting extends SettingsItem {
|
||||
* @return null if overwritten successfully otherwise; a newly created IntSetting.
|
||||
*/
|
||||
public void setSelectedValue(int selection) {
|
||||
if (selection == getSelectedValue()) {
|
||||
return;
|
||||
}
|
||||
final SharedPreferences.Editor editor = mPreferences.edit();
|
||||
editor.putInt(getKey(), selection);
|
||||
editor.apply();
|
||||
|
Loading…
x
Reference in New Issue
Block a user