Match Double type in string extras

This commit is contained in:
eisenhorn13
2020-07-19 01:50:42 +03:00
parent 47ff3d4c91
commit d36fb0ae14
3 changed files with 8 additions and 1 deletions
+4
View File
@@ -61,4 +61,8 @@ public class Assets extends CordovaPlugin {
return field.getInt(null);
}
protected boolean matchDoubleInSting(String str) {
return (Pattern.matches("([0-9]*)\\.([0-9]*)", str));
}
}
+3 -1
View File
@@ -250,7 +250,9 @@ public class startApp extends Assets {
LaunchIntent.putExtra(parseExtraName(key), extra.getInt(key));
}
if(value instanceof String) {
if(params.has("matchDoubleInSting") && matchDoubleInSting(extra.getString(key))) {
LaunchIntent.putExtra(parseExtraName(key), extra.getDouble(key));
} else if(value instanceof String) {
LaunchIntent.putExtra(parseExtraName(key), extra.getString(key));
}