String JSON = \"http://www.json-generator.com/j/cglqaRcMSW?indent=4\"; JSONObject jsonObject = new JSONObject(JSON); JSONObject getSth = jsonObject.getJSONObject(\"
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