如何将此字符串转换为 JSONArray ?
{"result":{"passion":[{"id":2,"description":"Sushi"},{"id":3,"description":"Dinner"},{"id":4,"description":"Sex"},{"id":5,"description":"Boobies"},{"id":6,"description":"Sleep"},{"id":7,"description":"Cars"},{"id":8,"description":"Travel"},{"id":9,"description":"Soccer"},{"id":10,"description":"Silice"}]}}
我正在尝试做:
JSONArray jsonArray = jsonObject.getJSONArray("passion");
但我遇到了一个例外:
org.json.JSONException: No value for passion