I have trouble understanding VOLLEY.
public void JsonArrayRequest(){ shops = new ArrayList<>(); request = new JsonArrayRequest(Request.Method.GET, url, null, new Response.Listener<JSONArray>() { @Override public void onResponse(JSONArray response) { } }, new Response.ErrorListener() { @Override public void onErrorResponse(VolleyError error) { error.printStackTrace(); } }); queue.add(request); } Logically, I call this request from somewhere above, from the layer with logic, I want to return the response from its working out and parse it, and then return it to the drawing. The problem is that I can only work with response from the onResponse method. I tried to: Announce another JSONArray in the class and map this response there and getter to it, but as soon as I do something with it not from onResponse, it is empty (. How to take this response correctly and give it to another layer?
onResponseis called, respectively, the logic of working with the result should be run from it, and not immediately after sending the request. - woesss pm