From e04f7c8f35f132356251b801dc5ac62dbbab0fcc Mon Sep 17 00:00:00 2001 From: Eric House Date: Mon, 18 Aug 2014 07:28:28 -0700 Subject: [PATCH] fix survey request display logic --- .../XWords4/src/org/eehouse/android/xw4/Utils.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/Utils.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/Utils.java index 6e2f20cdd..83337fe23 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/Utils.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/Utils.java @@ -513,7 +513,7 @@ public class Utils { private static void setFirstBootStatics( Context context ) { if ( null == s_isFirstBootThisVersion ) { - int thisVersion = getAppVersion( context ); + final int thisVersion = getAppVersion( context ); int prevVersion = 0; SharedPreferences prefs = context.getSharedPreferences( HIDDEN_PREFS, @@ -530,11 +530,13 @@ public class Utils { s_isFirstBootThisVersion = new Boolean( newVersion ); s_isFirstBootEver = new Boolean( -1 == prevVersion ); - int firstVersion = prefs.getInt( FIRST_VERSION_KEY, thisVersion ); + int firstVersion = prefs.getInt( FIRST_VERSION_KEY, 0 ); s_firstVersion = new Boolean( firstVersion == thisVersion ); - if ( newVersion || s_firstVersion ) { - SharedPreferences.Editor editor = prefs.edit() - .putInt( SHOWN_VERSION_KEY, thisVersion ); + if ( newVersion || 0 == firstVersion ) { + SharedPreferences.Editor editor = prefs.edit(); + if ( newVersion ) { + editor.putInt( SHOWN_VERSION_KEY, thisVersion ); + } if ( 0 == firstVersion ) { editor.putInt( FIRST_VERSION_KEY, thisVersion ); }