I can’t understand why this code is crashing, I have this response from my server:
[{
"parking1": "Plaza de la Estacion",
"parking2": "",
"takeDate": "2012-12-11 11:00:48",
"returnDate": null,
"time": null,
"cost": "0.00"
}]
I convert this into a JSONObject and check if returnDate is null:
JSONObject json_data = jArray.getJSONObject(0);
if (json_data.getString("returnDate") == null) {
}
But this condition is never true. How should it be checked if null?
You can check if a json entry is null using: