java json对象转换数组

public static Map getMap4Json(String jsonString){
        JSONObject jsonObject = new JSONObject( jsonString );  
        Iterator  keyIter = jsonObject.keys();
        String key;
        Object value;
        Map valueMap = new HashMap();
        while( keyIter.hasNext())
        {
            key = (String)keyIter.next();
            value = jsonObject.get(key);
            valueMap.put(key, value);
        }
        return valueMap;
    }

你可能感兴趣的:(android)