Skip to content

Commit 0aa83cb

Browse files
committed
Serialize "true"/"false" string values to Boolean when setting intent parameters.
1 parent b6f8479 commit 0aa83cb

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/main/java/org/medicmobile/webapp/mobile/ChtExternalApp.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,11 @@ private void setIntentExtras(Intent intent, String key, JSONObject data) {
9999
return;
100100
}
101101

102+
// ODK does not have boolean data type
103+
if (value instanceof String strValue && ("true".equals(strValue) || "false".equals(strValue))) {
104+
value = Boolean.parseBoolean(strValue);
105+
}
106+
102107
intent.putExtra(key, (Serializable) value);
103108

104109
} catch (Exception exception) {

0 commit comments

Comments
 (0)