我有这样的json字符串:
some/route/{platform}/{country}/
如何在不知道名称“2”的情况下解析JSONObject 刚搬到下一个阵列?
答案 0 :(得分:4)
String json="" // place your json format here in double Quotes with proper escapes .......
jObject = new JSONObject(json.trim());
Iterator<?> keys = jObject.keys();
while( keys.hasNext() ) {
String key = (String)keys.next();
if ( jObject.get(key) instanceof JSONObject ) {
// do what ever you want with the JSONObject.....
}
}