From 01ef5838d39e84658c03498bc45e0c2d4f3a677b Mon Sep 17 00:00:00 2001 From: serso Date: Sun, 7 Feb 2016 14:06:41 +0100 Subject: [PATCH] Don't set preferences every time the app starts --- .../java/org/solovyev/android/calculator/Preferences.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/app/src/main/java/org/solovyev/android/calculator/Preferences.java b/app/src/main/java/org/solovyev/android/calculator/Preferences.java index bec5d51a..30085596 100644 --- a/app/src/main/java/org/solovyev/android/calculator/Preferences.java +++ b/app/src/main/java/org/solovyev/android/calculator/Preferences.java @@ -64,6 +64,13 @@ public final class Preferences { Gui.showFixableErrorDialog.putDefault(preferences); Gui.lastPreferredPreferencesCheck.putDefault(preferences); + final Integer version = Preferences.appVersion.getPreference(preferences); + if (version == null) { + setInitialDefaultValues(preferences); + } + } + + private static void setInitialDefaultValues(@Nonnull SharedPreferences preferences) { if (!Engine.Preferences.groupingSeparator.isSet(preferences)) { final Locale locale = Locale.getDefault(); if (locale != null) {