Aj *_* 27 5 arrays android json
我正在尝试解析jsonArray但无法理解这种格式,如何解析这种类型jsonArray?谁能帮我?
"rows": [
[
"/farmfresh",
"20171211",
"4"
],
[
"/farmfresh/product/d",
"20171215",
"4"
],
[
"/farmfresh/product/h",
"20171222",
"2"
]
]
Run Code Online (Sandbox Code Playgroud)
尝试这个
try
{
JSONObject resObject = new JSONObject("your json response");
JSONArray jsonArray = resObject.getJSONArray("rows");
for (int i = 0; i < jsonArray.length(); i++) {
JSONArray jsonArray1 = jsonArray.getJSONArray(i);
for (int j = 0; j < jsonArray1.length(); j++) {
Log.i("Value","->" +jsonArray1.getString(j));
}
}
}
catch (JSONException e)
{
// TODO Auto-generated catch block
e.printStackTrace();
}
Run Code Online (Sandbox Code Playgroud)
输出
| 归档时间: |
|
| 查看次数: |
10483 次 |
| 最近记录: |