[ 11547212, 11546098, 11544988, 11546490, 11543083, 11544016, 11545112, 11545975, 11543258, 11541675, 11544510, 11543188, 11544254, 11544374, 11541702, 11545351, 11542995, 11542005, 11543646, 11540747, 11541834, 11541242, 11544686, 11544523, 11546077, 11543321, 11544010, 11544342, 11541474, 11547035, 11545970, 11544047, 11533500, 11547236, 11541971, 11543798, 11547042, 11542803, 11540825]
这是webservice https://hacker-news.firebaseio.com/v0/topstories.json?print=pretty的响应,这里每个id包含特定数据,这里是获取每个项目数据的服务 https://hacker-news.firebaseio.com/v0/item/11533382.json?print=pretty 这里如何获取所有项目的数据,如何反复调用第二个URL,最好的方式是什么。
答案 0 :(得分:0)
使用循环
for(int i = 0; i < json.length; i++){
//here is your code...
}
或将此JSONArray作为String