A JSONObject text must begin with '{' at 1 [character 2 line 1] with '{' error

前端 未结 12 795
失恋的感觉
失恋的感觉 2021-01-01 13:34
String JSON = \"http://www.json-generator.com/j/cglqaRcMSW?indent=4\";

JSONObject jsonObject = new JSONObject(JSON);
JSONObject getSth = jsonObject.getJSONObject(\"         


        
12条回答
  •  北荒
    北荒 (楼主)
    2021-01-01 14:09

    in my case my arraylist trhows me that error with the JSONObject , but i fin this solution for my array of String objects

    List listStrings= new ArrayList();
    String json = new Gson().toJson(listStrings);
    return json;
    

    Works like charm with angular Gson version 2.8.5

提交回复
热议问题