【发布时间】:2013-02-28 07:13:12
【问题描述】:
如何在JSONObject 中解析JSONArray?。这是我从服务器收到的JSON 响应。
{
"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 解析(而不是手动进行)。看这里的例子:javacodegeeks.com/2011/01/…
标签: java android json android-listview arrays