Cannot resolve method 'keys' in 'JSONObject'
//""自定义
String str = "";
JSONObject object = JSONObject.fromObject(str);
Map<String, Object> conditionMap = new HashMap<String, Object>();
Iterator<String> iterator = object.keys();
while (iterator.hasNext()){
String key = (String) iterator.next();
String val = object.getString(key);
System.out.println("[key="+key+"--> val="+val+"]");
conditionMap.put(key, val);
}
用
Iterator<String> iterator = object.keySet().iterator();
替换
Iterator<String> iterator = object.keys();