Search code examples
androidjsonexception

JSONException Error


Here is the stack trace.

Note that the Asynctask is working perfectly.

What is the problem here? Can anyone please help me?


Solution

  • You are trying to read property from array, use below syntax

    JSONArray array = new JSONArray (response.toString());
    JSONObject object = array.getJSONObject(0);
    String url = object.getString("image");