/**
* 将json格式的字符串解析成Map对象 <li>
* json格式:{"name":"admin","retries":"3fff","testname"
* :"ddd","testretries":"fffffffff"}
*/
private HashMap<String, String> toHashMap(JSONObject jsonObject) {
HashMap<String, String> data = new HashMap<String, String>();
Iterator it = jsonObject.keys();
// 遍历jsonObject数据,添加到Map对象
while (it.hasNext()) {
String key = String.valueOf(it.next());
String value = null;
try {
value = (String) jsonObject.get(key);
} catch (JSONException e) {
e.printStackTrace();
}
data.put(key, value);
}
return data;
}
* 将json格式的字符串解析成Map对象 <li>
* json格式:{"name":"admin","retries":"3fff","testname"
* :"ddd","testretries":"fffffffff"}
*/
private HashMap<String, String> toHashMap(JSONObject jsonObject) {
HashMap<String, String> data = new HashMap<String, String>();
Iterator it = jsonObject.keys();
// 遍历jsonObject数据,添加到Map对象
while (it.hasNext()) {
String key = String.valueOf(it.next());
String value = null;
try {
value = (String) jsonObject.get(key);
} catch (JSONException e) {
e.printStackTrace();
}
data.put(key, value);
}
return data;
}