0
我試圖解析其中包含一個JSON:JSON解析一個JSONObject無鑰匙
"images": [
"https://d1wgio6yfhqlw1.cloudfront.net/sysimages/product/resized6/Interior_St_Pauls_Cathedral_132_12992.jpg",
"https://d1kioxk2jrdjp.cloudfront.net/resized/486x324/48-st_pauls_ctahedral_millenirm_bridge.jpg",
"http://i4.mirror.co.uk/incoming/article8299330.ece/ALTERNATES/s615b/LOND-2016-052-HMQ-St-Pauls-Thanks-Giving-704JPG.jpg"
]
的問題是,我不知道如何讓「圖像」節點
中的元素串我的代碼目前的樣子:
if(c.has("images") && !c.isNull("images")){
JSONArray imagenes = jsonObj.getJSONArray("images");
for (int j = 0; j < imagenes.length(); j++) {
JSONObject m = imagenes.getJSONObject(i);
}
}
我怎樣才能獲得陣列中的每個字符串,而無需使用「鑰匙」?
接下來我不知道該如何處理「M」。
謝謝!這將使它! – Asdemuertes
這個知識幫助了我......我認爲在json數組中只有我們可以得到json對象....... :) –
@KiranBennyJoseph閱讀文檔。 https://developer.android.com/reference/org/json/JSONArray.html –