我有想要解析为 JSONObject 的 json。当我这样做时,它会打乱 json 的顺序,见下文。我怎样才能解决这个问题?
原始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"
}
}
}
解析为 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"
}
}
}
我的代码:
private void ProcessResponse(String response) {
JSONObject json = new JSONObject(response);
}