在您的json中,的值
GetNotesResult包含在其中,
""因此将其视为字符串而不是数组。
被解析为一个数组。
{"GetNotesResult":[{"ID":1,"Title":"Note 1","Content":"Hello Vu Chien Thang","CreatedBy":"thangvc"},{"ID":2,"Title":"Note 2","Content":"Hello Nguyen Thi Ngoc","CreatedBy":"thangvc"}]}因此,解决方案是两件事之一:
- 如果可以修改服务器响应,请
""
从json数组周围删除。要么 - parse it first as string and then create a json array from that string..
String notes = jobj.getString("GetNotesResult"); jarray = new JSonArray(notes);


