如何分析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