如何分析JSONArray
里面JSONObject
?这是我从服务器获得的JSON
响应。解析的JSONObject和JSONArray和修复它们在列表视图
{
"searchdata": {
"titles": [
"<b>Laptop</b> - Wikipedia, the free encyclopedia",
"<b>laptop</b> - definition of <b>laptop</b> by the Free Online Dictionary ..."
],
"desc": [
"A <b>laptop</b> computer is a personal computer for mobile use. A <b>laptop</b> has most of the same components as a desktop computer, including a display, a keyboard, a ...",
"lap·top (l p t p) n. A portable computer small enough to use on one's lap. <b>laptop</b> [ˈlæpˌtɒp], <b>laptop</b> computer. n (Electronics & Computer Science/Computer ..."
],
"links": [
"http://en.wikipedia.org/wiki/Laptop",
"http://www.thefreedictionary.com/laptop"
],
"nextpage": ""
}
}
我能够得到JSONObject
但如何通过一个拿到JSONArray一个,这样我就可以在listview
解决这些问题。
我要显示的每个数组的值在listview
等单行....
任何帮助将不胜感激。
您可以使用GSON库进行JSON解析(而不是手动执行)。看看这里的例子:http://www.javacodegeeks.com/2011/01/android-json-parsing-gson-tutorial.html – Piotr 2013-02-28 08:04:44