【发布时间】:2014-06-12 22:06:20
【问题描述】:
我有一个名为“response”的字符串,如下所示:
{"test": {
"id": 179512,
"name": "Test",
"IconId": 606,
"revisionDate": 139844341200,
"Level": 20
}}
我想将 id 值保存到变量中。我该怎么做?
JSONObject jsonObj = new JSONObject(response);
jsonObj.getInt("id");
这不起作用。
【问题讨论】: