From a9d86f25244291fbecc8bb415f4ca0dc412400e5 Mon Sep 17 00:00:00 2001 From: Garret Yoder Date: Sat, 8 Oct 2016 17:17:24 -0400 Subject: [PATCH] Update build number and invalidate caches on a new version --- app/build.gradle | 2 +- .../subreddit/android/appstore/AppStoreApp.java | 14 +++++++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 1c2f340..a3bebf9 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -26,7 +26,7 @@ android { buildToolsVersion "24.0.2" def versionMajor = 0 - def versionMinor = 6 + def versionMinor = 7 def versionPatch = 0 def versionBuild = 0 diff --git a/app/src/main/java/subreddit/android/appstore/AppStoreApp.java b/app/src/main/java/subreddit/android/appstore/AppStoreApp.java index 74ccc4f..a9c5cf0 100644 --- a/app/src/main/java/subreddit/android/appstore/AppStoreApp.java +++ b/app/src/main/java/subreddit/android/appstore/AppStoreApp.java @@ -2,6 +2,7 @@ import android.app.Application; import android.content.Intent; +import android.content.SharedPreferences; import android.preference.PreferenceManager; import com.squareup.leakcanary.LeakCanary; @@ -33,9 +34,20 @@ protected void log(final int priority, final String tag, final String message, } }); } + clearCache(); + SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this); refWatcher = LeakCanary.install(this); Injector.INSTANCE.init(this); - theme = Integer.parseInt(PreferenceManager.getDefaultSharedPreferences(this).getString("theme", "0")); + theme = Integer.parseInt(prefs.getString("theme", "0")); + } + + private void clearCache() { + SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this); + if (prefs.getInt("APP_VERSION",0)