android Json Api键值嵌套如何使用
Android Json Api密钥嵌套如何使用?MsgID、UsrID重复如何调用?截击 我有一个json,它有许多嵌套的JSONARRAYandroid Json Api键值嵌套如何使用,android,android-volley,Android,Android Volley,Android Json Api密钥嵌套如何使用?MsgID、UsrID重复如何调用?截击 我有一个json,它有许多嵌套的JSONARRAY { "status": "success", "data": { "2547": { "MsgID": "2547", "UsrID": "352", "MsgID": "221", "ThroughUsrID": null, "MsgID": "1",
{
"status": "success",
"data": {
"2547": {
"MsgID": "2547",
"UsrID": "352",
"MsgID": "221",
"ThroughUsrID": null,
"MsgID": "1",
"MsgDt": "2016-03-22 11:55:13",
"buscard": {
"UsrID": "221",
"EntID": "7",
"EntID": "1",
"UsrFavorites": 0,
"UsrLinkSts": "connected"
},
}
}
我认为您正在尝试解析Json数据。尝试这样做:
try {
JSONObject jsonObject = new JSONObject(stringToParse);
JSONObject data = jsonObject.optJSONObject("data");
JSONObject tempData = data.optJSONObject("2547");
String msgID = tempData.optString("MsgID");
// Similarly parse other info
JSONObject busCard = tempData.optJSONObject("buscard");
//Again parse required data from busCard
} catch (JSONException e) {
e.printStackTrace();
}
请您提高英语水平,如果您这样写,“MsgID,UsrID Repeat how to call?Volley”,听众将无法理解。请仔细阅读本教程:您能否编辑您的问题,因为很难理解您的问题。