2
My problem is basically the following, I have a JSON code that takes the data from a URL, and returns it to me (The values are in Long)
528593
444218
5693595
2466912
2466435
However, it returns this to me in a single variable (in this case, the "wtfbo"), and I need to divide this into a string for each one to fit into the interface I have already assembled. In case, I am using this code at the moment
[...]
Iterator<?> it = eat.iterator();
while (it.hasNext()) {
JSONObject dash = (JSONObject) it.next();
Long wtfb10 = (Long) dash.get("teamId");
if(wtfb10==100){
Long wtfbo = (Long) dash.get("summonerId");
String play = (String) dash.get("summonerName");
String ko = wtfbo.toString();
System.out.println(ko);
}}
[...]
Any idea?
//EDIT: In short, the "Long wtfbo" will return 5 different summonerId, only everything in it, I need it to return in 5 different strings, each one having a summonerID.
How is the structure of JSON?
– Renan Gomes
http://pastebin.com/TjjJ4jWk is identical to this, in which case I need to take the summonersID/summonerName of the 10 players.
– Rikeard
In the JSON you sent each ID there is a different object. What you mean by "returns it in a single variable"?
– André Ribeiro
is that all 10 different summonerId, return everything on "wtfbo"
– Rikeard
Related: http://answall.com/questions/49838/howto get m%C3%Baltiplos-jsonobject-com-a-mesma-key
– Victor Stafusa