[{"data":{"statues":"2"}}] であるローカル ホストからのデータを解析しようとしています。
これはJSONの私のコードです:
JSONArray jArray = new JSONArray(result);
for(int i=0;i<jArray.length();i++){
JSONObject json_data = jArray.getJSONObject(i);
Log.i("log_tag","statues: "+json_data.getString("statues"));
//Get an output to the screen
returnString = json_data.getString("statues");
tv.setText(returnString);
すべて問題ないように思えますが、私の log-cat では次のエラーが発生します。
11-15 09:07:27.403: E/log_tag(3037): Error in http connection!!org.json.JSONException: Value [{"data":{"statues":"2"}}] of type org.json.JSONArray cannot be converted to JSONObject
彫像をキャッチするので問題ないように聞こえますが、その値 (2) はキャッチしません。も試しjson_data.getInt("statues");
ましたが、問題は同じです。
私は何をすべきか?!