import org.json.JSONArray; import org.json.JSONObject; //jsonData的数据格式:[{ "id": "27JpL~jd99w9nM01c000qc", "version": "abc" },{ "id": "27JpL~j6UGE0LX00s001AH", "version": "bbc" },{ "id": "27JpL~j7YkM0LX01c000gt", "version": "Wa_" }] JSONArray arr = new JSONArray(jsonData); for (int i = 0; i < arr.length(); i++) { JSONObject temp = (JSONObject) arr.get(i); String id = temp.getString("id"); String id = temp.getString("version"); }
时间: 2024-11-05 04:38:35