次のようにURLから出力しました:
["HANK-TPSSL4-app","acgeneral-app","acgeneral-web","achalf-app","acproduct-app"]
この配列から各オブジェクトを取得する私の Java コード:
BufferedReader in = new BufferedReader(new InputStreamReader((HttpURLConnection) alertHandleUrl.openConnection().getInputStream()));
String output;
while ((output = in.readLine()) != null) {
JSONArray array = new JSONArray(output);
for (int i =0; i < array.length(); i++)
JSONObject row = array.getJSONObject(i);
System.out.println(row);
}
私が得ているエラーは
スレッド「メイン」org.json.JSONException の例外: JSONArray[0] は JSONObject ではありません。org.json.JSONArray.getJSONObject(JSONArray.java:330) で com.ebay.sherlock.calc.AutoConfigFunc.main(AutoConfigFunc.java:70) で
誰かが私を助けることができますか?前もって感謝します