Android Volley - Waiting for multiple responses to complete and then do something -
so basically, send 3 requests using volley retrieve data database. because i'm using different adapters instances display each set of data. send them in order
request1request2request3
i have put code inside onresponse() method of response3 processes data retrieved previous requests too. need wait all responses finish before processing.
here lies problem though. there times request3 has least data retrieve, finishing faster others. responses this:
response3. here code processes dataresponse1,response2executes before 2 have finished, getting wrong results.response1response2
if there way wait all responses finish, can put processing code in method. don't know how that. ideas?
simply write 2 methods:
executesecondrequeset() has response2
executethirdrequeset() has response3
and inside onresponse() of first request call executesecondrequeset() declared , in onresponse() of call executethirdrequeset() method :)
Comments
Post a Comment