最后,我使用
JSONObject.get而不是来解决它
JSONObject.getString,然后将其强制
test转换为
String。
private void saveData(String result) { try { JSonObject json= (JSONObject) new JSonTokener(result).nextValue(); JSonObject json2 = json.getJSonObject("results"); test = (String) json2.get("name"); } catch (JSonException e) { e.printStackTrace(); }}


