fix SP for long with string-ressource-id

This commit is contained in:
AdrianLxM 2017-12-01 13:49:50 +01:00
parent d1aec1ff18
commit 4b063a7766

View file

@ -65,7 +65,11 @@ public class SP {
}
static public long getLong(int resourceID, Long defaultValue) {
return SafeParse.stringToLong(sharedPreferences.getString(MainApp.sResources.getString(resourceID), defaultValue.toString()));
try {
return sharedPreferences.getLong(MainApp.sResources.getString(resourceID), defaultValue);
} catch (Exception e) {
return SafeParse.stringToLong(sharedPreferences.getString(MainApp.sResources.getString(resourceID), defaultValue.toString()));
}
}
static public long getLong(String key, Long defaultValue) {