Permalink
Browse files

Fixing bug in settings migration on first run. Adding 30 minutes auto…

…submit option
  • Loading branch information...
1 parent 4b75211 commit 4704fed0129b7ac2ba2fa7669437dac82d004b43 @JacobSheehy committed Feb 5, 2013
Showing with 7 additions and 1 deletion.
  1. +2 −0 res/values/strings.xml
  2. +5 −1 src/ca/cumulonimbus/barometernetwork/BarometerNetworkActivity.java
View
@@ -20,6 +20,7 @@
<item name="1 minute">1 minute</item>
<item name="5 minutes">5 minutes</item>
<item name="10 minutes">10 minutes</item>
+ <item name="30 minutes">30 minutes</item>
<item name="1 hour">1 hour</item>
<item name="6 hours">6 hours</item>
<item name="12 hours">12 hours</item>
@@ -28,6 +29,7 @@
<item name="1 minute">1 minute</item>
<item name="5 minutes">5 minutes</item>
<item name="10 minutes">10 minutes</item>
+ <item name="10 minutes">30 minutes</item>
<item name="1 hour">1 hour</item>
<item name="6 hours">6 hours</item>
<item name="12 hours">12 hours</item>
@@ -214,14 +214,18 @@ private void migratePreferences() {
String unit = oldSettings.getString("units", "Millibars (mbar)" );
String autoFrequency = oldSettings.getString("autofrequency", "10 minutes");
String sharing = oldSettings.getString("sharing_preference", "Us, Researchers and Forecasters");
-
+ int firstRun = oldSettings.getInt("first_run", 1);
+
+ firstRun++;
+
// Store
SharedPreferences newSharedPreferences = PreferenceManager.getDefaultSharedPreferences(this);
SharedPreferences.Editor editor = newSharedPreferences.edit();
editor.putBoolean("autoupdate", autoUpdate);
editor.putString("units", unit);
editor.putString("autoFrequency", autoFrequency);
editor.putString("sharing_preference", sharing);
+ editor.putInt("first_run", firstRun);
editor.commit();
}
}

0 comments on commit 4704fed

Please sign in to comment.