这是个主意:
JSonObject root = new JSonObject(yourJsonString);JSonArray sportsArray = root.getJSonArray("sports");// now get the first element:JSonObject firstSport = sportsArray.getJSonObject(0);// and details of the first elementString name = firstSport.getString("name"); // basketballint id = firstSport.getInt("id"); // 40JSonArray leaguesArray = firstSport.getJSonArray("leagues");// and so on, you can process leaguesArray similarly
它应该可以工作(如果有编译错误,请随时投诉)
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)