ここに私のコードスニペットがあります:
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
。