Когда я вызываю свой веб-сервис, у меня есть это исключение: org.json.JSONException:Value[{}]
типа org.json.JSONArray
нельзя преобразовать в JSONObject
private void jsonParse(){
String url="http://192.168.56.1:8095/rest/workouts/all";
JsonObjectRequest request = new JsonObjectRequest(Request.Method.GET, url, null,
new Response.Listener<JSONObject>() {
@Override
public void onResponse(JSONObject response) {
try {
JSONArray jsonArray = response.getJSONArray("");
for(int i = 0; i < jsonArray.length(); i++) {
JSONObject w = jsonArray.getJSONObject(i);
String title = w.getString("title");
String goal = w.getString("goal");
txtv.append(title + ", " + goal +"\n\n");
}
...
Кстати, это формат JSON
[{"id":"1","title":"title","goal":"goal","exercice":"Exercice
1","difficulty":"Beginner","duration":"3","image":"..","description":"..."},]
JsonArrayRequest
вместоJsonObjectRequest
- person Savin Sharma   schedule 04.12.2018