Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
jamenlang committed Jun 5, 2015
1 parent 4524b38 commit cd824bf
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ android {
minSdkVersion 21
targetSdkVersion 21
versionCode 2
versionName "2.1.1"
versionName "2.1.3"
}
}
17 changes: 12 additions & 5 deletions app/src/main/java/com/airlim/garagetrois/Client_Functions.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@
import java.io.InputStream;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import static junit.framework.Assert.assertEquals;

Expand All @@ -55,11 +57,16 @@ public static int getPrefInt(String key, Context context) {
SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(context);

String sleepytime = preferences.getString(key, "11.0");
Log.v("preference", sleepytime);
//return Integer.parseInt(String.valueOf(Double.longBitsToDouble(preferences.getLong(key, Double.doubleToLongBits(11.0)))));
if (sleepytime != null) {
sleepytime = sleepytime.split("\\.", 2)[0];
sleepytime = sleepytime.replace(".", "");

if(sleepytime.contains(".")){
String[] numbers = sleepytime.split("\\.");
Log.v("preference", numbers[0]);
Log.v("preference", numbers[1].substring(0,1));
sleepytime = numbers[0] + numbers[1].substring(0,1);
Log.v("preference", sleepytime);
}
else {
sleepytime = sleepytime + "0";
}

return Integer.parseInt(sleepytime);
Expand Down

0 comments on commit cd824bf

Please sign in to comment.