Skip to content

Commit

Permalink
fix #292
Browse files Browse the repository at this point in the history
  • Loading branch information
ramack committed Apr 18, 2022
1 parent b3ac980 commit 11f7f39
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -211,11 +211,12 @@ private void updateLocationDist() {
String value = PreferenceManager
.getDefaultSharedPreferences(ActivityDiaryApplication.getAppContext())
.getString(KEY_PREF_LOCATION_DIST, def);
if(value.length() == 0){
value = "0";
}

int v = Integer.parseInt(value.replaceAll("\\D",""));
if(v < 5){
v = 5;
}

String nvalue = Integer.toString(v);
if(!value.equals(nvalue)){
SharedPreferences.Editor editor = PreferenceManager
Expand All @@ -235,6 +236,9 @@ private void updateLocationAge() {
String value = PreferenceManager
.getDefaultSharedPreferences(ActivityDiaryApplication.getAppContext())
.getString(KEY_PREF_LOCATION_AGE, def);
if(value.length() == 0){
value = "5";
}
int v = Integer.parseInt(value.replaceAll("\\D",""));
if(v < 2){
v = 2;
Expand Down

0 comments on commit 11f7f39

Please sign in to comment.