I have this JSONObject:
{
"gutter_url" : "",
"sort_order" : "popularity",
"result" : [
{
"afs" : "Y",
"release_year" : 1979,
"album_sort" : "Wall, The"
}
]
}
and want to get the Array at the position "result", so I wrote this code:
JSONObject allCDs = new JSONObject(objectString);
JSONArray CD_List = allCDs.getJSONArray("result");
But then I get this Exception:
Exception in thread "main" org.json.JSONException: A JSONObject text must begin with '{' at character 1
at org.json.JSONTokener.syntaxError(JSONTokener.java:410)
at org.json.JSONObject.<init>(JSONObject.java:179)
at org.json.JSONObject.<init>(JSONObject.java:402)
at de.htwberlin.gim.Aufgabe8_5.getCoversFor(Aufgabe8_5.java:55)
at de.htwberlin.gim.Aufgabe8_5.main(Aufgabe8_5.java:77)