I want to parse a nested 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");
I am getting jsonobject cannot be converted to jsonarray
error on
dialogs = d.getJSONArray("dialogdetails");
line
my json array
{"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":"[email protected]","d_category_id":"2","d_category_name":"Games"}}]}
JsonObject
not aJsonArray
– Nezam Oct 22 '13 at 8:29[
represent JSONArray,{
represent JSONObject – Tom Hart Oct 22 '13 at 8:29