I have json that I want to parse as a JSONObject. When I do so, it messes up the order of the json, see below. How can I fix this?
original json:
{"result":
{"headers":
{
"month_1":"May 2013",
"month_2":"April 2013",
"month_3":"March 2013",
"month_4":"February 2013",
"month_5":"January 2013",
"month_6":"December 2012",
"month_7":"November 2012"
}
}
}
After parsing to JSONObject:
{"result":
{"headers":
{
"month_6":"December 2012",
"month_5":"January 2013",
"month_4":"February 2013",
"month_3":"March 2013",
"month_2":"April 2013",
"month_1":"May 2013",
"month_7":"November 2012"
}
}
}
My code:
private void ProcessResponse(String response) {
JSONObject json = new JSONObject(response);
}