mirror of
https://github.com/moparisthebest/k-9
synced 2025-01-31 15:20:09 -05:00
Addition of number format handling to Storage.java
This commit is contained in:
parent
9409435aa7
commit
6e27a90905
@ -321,7 +321,11 @@ public class Storage implements SharedPreferences {
|
|||||||
if (val == null) {
|
if (val == null) {
|
||||||
return defValue;
|
return defValue;
|
||||||
}
|
}
|
||||||
return Float.parseFloat(val);
|
try{
|
||||||
|
return Float.parseFloat(val);
|
||||||
|
} catch (NumberFormatException nfe){
|
||||||
|
return defValue;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//@Override
|
//@Override
|
||||||
@ -330,7 +334,11 @@ public class Storage implements SharedPreferences {
|
|||||||
if (val == null) {
|
if (val == null) {
|
||||||
return defValue;
|
return defValue;
|
||||||
}
|
}
|
||||||
return Integer.parseInt(val);
|
try {
|
||||||
|
return Integer.parseInt(val);
|
||||||
|
} catch (NumberFormatException nfe){
|
||||||
|
return defValue;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//@Override
|
//@Override
|
||||||
@ -339,7 +347,11 @@ public class Storage implements SharedPreferences {
|
|||||||
if (val == null) {
|
if (val == null) {
|
||||||
return defValue;
|
return defValue;
|
||||||
}
|
}
|
||||||
return Long.parseLong(val);
|
try{
|
||||||
|
return Long.parseLong(val);
|
||||||
|
} catch (NumberFormatException nfe){
|
||||||
|
return defValue;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//@Override
|
//@Override
|
||||||
|
Loading…
Reference in New Issue
Block a user