我想解析一个嵌套的 jsonarray
JSONParser jParser = new JSONParser();
// getting JSON string from URL
JSONObject json = jParser.getJSONFromUrl(url);
try {
dialogcreated = json.getJSONArray(TAG_DETAILS);
// Log.d("apptoken",login.toString());
for (int i = 0; i < dialogcreated.length(); i++) {
JSONObject d = dialogcreated.getJSONObject(i);
String msg = d.getString(TAG_MSG);
dialogs = d.getJSONArray("dialogdetails");
我在网上遇到jsonobject cannot be converted to jsonarray
错误
dialogs = d.getJSONArray("dialogdetails");
我的 json 数组
{"dialog_details":[{"msg":"success","dialogdetails":{"dialog_id":"139","dialog_category":"2","dialog_title":"apptesting1","dialog_description":"apptesting2","dialog_image":null,"dialog_type":"P","mem_id":"27","temp_moderator_assigned":"0","moderator_assigned":"0","created_on":"6 minutes ago","updated_by":null,"updated_on":"6 minutes ago","mem_dialog_type":"P","published":"0","dialog_status":"1","dialog_archived":"0","dialog_votes":"0","featured":"0","dialog_members":"0","dialog_posts":"0","wtavg":"0","d_member_username":"icube2","d_mem_id":"27","d_member_avatar":"0","d_member_email":"icube1solutions@gmail.com","d_category_id":"2","d_category_name":"Games"}}]}