美文网首页
json 里面获取key值

json 里面获取key值

作者: _夏兮 | 来源:发表于2016-06-03 15:38 被阅读356次

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值

      本文链接:https://www.haomeiwen.com/subject/zvxldttx.html