JSonObject JObject = new JSonObject(response); String getting_data = JObject.getstring("getting data"); String Todays= JObject.getstring("Todays"); JsonArray results =JObject.getjsonarray("results"); for(int i = 0 ; i < results.length(); i++){ JsonObject resultsobject =results.getjsonobject(i); JsonArray worldpopulation =resultsobject.getjsonarray("worldpopulation"); for(int j = 0 ; j < worldpopulation.length(); j++){ JsonObject worldpopulationobject =worldpopulation.getjsonobject(j); JsonObject emptyobject =worldpopulationobject.getjsonobject(""); String rank=emptyobject .getstring("rank"); String population=emptyobject .getstring("population"); JsonArray flagarray =countrypulation.getjsonarray(flag); for(int n = 0 ; n < flagarray.length(); n++){ JsonObject flagarrayobject =flag1array.getjsonobject(n); String flag=flag1arrayobject .getstring("flag"); } JsonObject populationobject =worldpopulationobject.getjsonobject("population"); JsonArray emptyarray =JObject.getjsonarray(""); for(int k = 0 ; k < emptyarray.length(); k++){ JsonObject emptyarrayobject =emptyarray.getjsonobject(k); JsonObject countrypulation=emptyarrayobject.getjsonobject("countrypulation"); String rank1=countrypulation .getstring("rank"); String country=countrypulation .getstring("country"); String population1=countrypulation .getstring("population"); JsonArray flag1array =countrypulation.getjsonarray(flag); for(int m = 0 ; m < flag1array.length(); m++){ JsonObject flag1arrayobject =flag1array.getjsonobject(m); String flag1=flag1arrayobject .getstring("flag"); } } } }
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)