-5
得到一个特定的项目我有这些JSONArray如何从JSONArray
[
{
"cid": "6",
"pid": "0",
"nid": "28",
"uid": "1",
"subject": "ciaooo",
"hostname": "62.98.160.246",
"created": "1441816543",
"changed": "1441816543",
"status": "1",
"thread": "04/",
"name": "uniwalltest",
"mail": "",
"homepage": "",
"language": "und",
"uri": "http://uniwalltest.altervista.org/portale/?q=app/comment/6"
},
{
"cid": "5",
"pid": "0",
"nid": "28",
"uid": "1",
"subject": "rhdhdhdjj cisioos",
"hostname": "62.98.160.246",
"created": "1441816301",
"changed": "1441816301",
"status": "1",
"thread": "03/",
"name": "uniwalltest",
"mail": "",
"homepage": "",
"language": "und",
"uri": "http://uniwalltest.altervista.org/portale/?q=app/comment/5"
}
]
我不会显示仅须与NID 28项,这是我的代码:
for(int j=0;j<result.length();j++) {
try {
title.add(result.getJSONObject(j).getString("subject").toString());
} catch (Exception e) {
Log.v("Error", e.getMessage());
}
}
谢谢,
检查http://github.com/mohit008/Android-Json-例子 – Mohit
JSONArray的关键是什么? – Rajesh