It’s a good point. But as far as I know, opt-functions return non-null value.
For example:
public String optString (String name,
String fallback)
returns fallback
if there’s no key name
in JSONObject
, but sometimes you need null
.
optString
without second argument is the same as optString(key, "")
.
Please correct me if I’m missing something.