Value of type org.json.JSONArray cannot be converted to JSONObject

后端 未结 2 1584
南旧
南旧 2021-02-13 17:56

Got stuck at this error:

3169-3190/com.meisolsson.app E/JSON Parser﹕ Error parsing data org.json.JSONException: Value [{\"type\":0,\"can_see_custom_stori

2条回答
  •  遥遥无期
    2021-02-13 18:44

    [..] means it should be an JSONArray and {..} means it should be a JSONObject.

    Therefore:

    try {
            JSONArray jObj = new JSONArray(json);
        } catch (JSONException e) {
            Log.e("JSON Parser", "Error parsing data " + e.toString());
        }
    

提交回复
热议问题