錯誤解析數據org.json.JSONException:什麼是錯誤表示Android中(JSON)錯誤解析數據org.json.JSONException:
java.lang.String類型的值不能轉化爲JSONArray
JSONArray jsonArray = new JSONArray(result);
JSONArray ja= (JSONArray) jsonArray.get(0);
JSONObject jb = (JSONObject) ja.get(0);
//String firstvalue = jb.getString("0");
int secondvalue = jb.getInt("customer_id");
Myjson輸出謹[[{"0":"2","customer_id":"2"}]]
我正在jenerating使用PHP輸出像
$output[]= $customerid;
print(json_encode($output));
在這裏發表您的JSON。 – Raghunandan
@Raghunandan我試過你的代碼,說上述錯誤。 – Vini
在SO本身發佈您的問題。 – Raghunandan