在这里,您可以检索所有json数据,询问特定的键和innerKey以获取所需的内容,干杯
try {String jsonString="";//your json string here JSonObject jObject= new JSonObject(jsonString).getJSonObject("categories"); Iterator<String> keys = jObject.keys(); while( keys.hasNext() ) { String key = keys.next(); Log.v("**********", "**********"); Log.v("category key", key); JSonObject innerJObject = jObject.getJSonObject(key); Iterator<String> innerKeys = innerJObject.keys(); while( innerKeys.hasNext() ) { String innerKkey = keys.next(); String value = innerJObject.getString(innerKkey); Log.v("key = "+key, "value = "+value); } } } catch (JSonException e) { e.printStackTrace(); }
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)