Start a new topic

How a query can stay on the "onSuccess" until data is obtained

while running a query on the kinvey database I need to stay at the "onSuccess" until it returns the values I need, and then continue running.

At the momento while the query is running start running the next method without the results it needs from the last query.

Thanks for your help!
1 Comment


The idea is that requests are executed asynchronously in the background -- since we don't know how long they will take, we let them take as long as they need. Once a request has completed, onSuccess (or onFailure) will be called.

What you can do is move your code that you need to wait on right into the OnSuccess block. So once the query finally completes (which might take a while with a poor network connection!), the code within onSuccess will be called. From there, you will know that the query has finished.

Login or Signup to post a comment