In my application, the functionality is as below:
First I am creating JsonObjectRequest using Volley. This returns me the JSON data. Here I used this technique with callback to make sure I’m getting the response and then processing it further.
From JSON data I received above (1), I get the multiple URLs from which I need to get more data. In the onResponse of the first request above (1), I am calling a method which creates new request queue and create and add requests for all these individual URLs to the same. My final objective is to display the data after I get the all the data from this step, i.e. multiple URLs.
What is happening: I’m able to fetch the data from (1) above and display correctly but it is not waiting for downloading the data from step (2) above. I guess I cannot add the requests in (2) in the request queue of (1) because first I need the urls from request 1 to process in request 2.
How can I wait in my application for data download complete from step (2) as well?
Let me know if the question is not clear. I’ll try to add more details.