这是我的代码片段:
jArray = jChild.getJSONArray("users");
for (int i = 0; i < jArray.length(); i++) {
JSONObject jObject = (JSONObject) jArray.get(i); //Exception thrown in this line
}
编辑:
日志猫:
09-30 09:06:23.404: E/AndroidRuntime(4011): java.lang.RuntimeException: An error occured while executing doInBackground()
09-30 09:06:23.404: E/AndroidRuntime(4011): at android.os.AsyncTask$3.done(AsyncTask.java:200)
09-30 09:06:23.404: E/AndroidRuntime(4011): Caused by: java.lang.ClassCastException: java.lang.String
09-30 09:06:23.404: E/AndroidRuntime(4011): at com.example.DbAccess.loadMonthView(DbAccess.java:196)
这是我的 jsonArray:
[{"uid":"6","status":"absent","name":"xyz"},{"uid":"7","status":"absent","name":"abc Paul"}]
我想JSONObject
从JSONArray
.