I have the following JSON string:
{"widget":{"order":{"fizz":["23", "55"],"setting":"always"}},"resp":"ok"}
And the following Java code:
try {
JSONObject json = getTheAboveStringAsJSON();
order = json.getJSONObject("order");
} catch(JSONException e) {
throw new RuntimeExcept(e.getMessage());
}
Giving me the following exception:
JSONObject["order"] not found.
java.lang.RuntimeException: JSONObject["order"] not found.
What's going on here? Why the exception? What can I do to fix it? Thanks in advance!
orderis a level down from the top of the object. e.g.$json->widget->order, not$json->order.