错误说明发生了什么问题…您返回的是数组而不是JSon对象
尝试如下:
JSonArray ja = new JSonArray(jsonStringReturnedByService);Data sections = new Data();for (int i = 0; i < ja.length(); i++) { Section s = new Section(); JSonObject jsonSection = ja.getJSonObject(i); s.SectionId = Integer.ValueOf(jsonSection.getString("SectionId")); s.SectionName = jsonSection.getString("SectionName"); //add it to sections list sections.add(s);}return sections;
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)