From 3f34fdc89e6c6d26a2f1defd15b9f2c65d128d05 Mon Sep 17 00:00:00 2001 From: serso Date: Sun, 27 Mar 2016 15:15:26 +0200 Subject: [PATCH] Default value shouldn't be set --- .../java/org/solovyev/android/calculator/UiPreferences.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/org/solovyev/android/calculator/UiPreferences.java b/app/src/main/java/org/solovyev/android/calculator/UiPreferences.java index 00a24233..5634461a 100644 --- a/app/src/main/java/org/solovyev/android/calculator/UiPreferences.java +++ b/app/src/main/java/org/solovyev/android/calculator/UiPreferences.java @@ -2,7 +2,6 @@ package org.solovyev.android.calculator; import android.content.SharedPreferences; import android.support.annotation.NonNull; - import org.solovyev.android.prefs.BooleanPreference; import org.solovyev.android.prefs.IntegerPreference; import org.solovyev.android.prefs.Preference; @@ -32,6 +31,9 @@ final class UiPreferences { } private static void migratePreference(@NonNull SharedPreferences uiPreferences, @Nonnull SharedPreferences preferences, @NonNull SharedPreferences.Editor uiEditor, @NonNull Preference uiPreference, @NonNull Preference preference) { + if (!preference.isSet(preferences)) { + return; + } if (!uiPreference.isSet(uiPreferences)) { uiPreference.putPreference(uiEditor, preference.getPreferenceNoError(preferences)); }