我的JSONArray是
[ {"id":1, "programs_idprograms":3, "description":"course description", "idCourse":"course title" }, {"id":2, "programs_idprograms":3, "description":"course description2", "idCourse":"course title2" } ]
存储在名为bean2的字符串中
JSONArray array = new JSONArray(bean2); for(int i=0;i<array.length();i++){ JSONObject object = array.getJSONObject(i); int id = object.getInt("id"); int programs_idprograms = object.getInt("programs_idprograms"); String description = object.getString("description"); String idCourse = object.getString("idCourse"); }