json 里面获取key值

public static ArrayListgetKeyValue(String JsonString){

ArrayListkeyList = new ArrayList();

String key="";

try {

JSONObject obj= new JSONObject(JsonString);

Iterator it = obj.keys();

while (it.hasNext()) {

key= (String)it.next().toString();

keyList.add(key);

}

} catch (JSONException e) {

e.printStackTrace();

}

return keyList;

}

你可能感兴趣的:(json 里面获取key值)