に変換できません。サービスWebを呼び出すときに例外があります。org.json.JSONException:型の値[{}] org.json.JSONArrayはJSONObjectorg.json.JSONException:org.json.JSONArray型の値[{}]をJSONObject
に変換することはできません、これは私のソースコードです:
JsonObjectRequest obreq = new JsonObjectRequest(Request.Method.GET, url + editText.getText().toString(), null,
new Response.Listener<JSONObject>() {
@Override
public void onResponse(JSONObject response) {
try {
JSONArray missions = response.getJSONArray("Value");
for(int i=0;i<missions.length();i++){
// Get current json object
JSONObject mission = missions.getJSONObject(i);
// Get the current student (json object) data
Long idMission = mission.getLong("idMission");
String etatMission = mission.getString("etatMission");
text.append(idMission+" " + etatMission);
text.append("\n\n");
}
}catch (JSONException e) {
e.printStackTrace();
}
}
},
new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
text.setText(error.getMessage());
}
}
);
requestQueue.add(obreq);