Waiting for Robospice requests to finish

384 Views Asked by At

I'm using Robospice in my Android app to get data in JSON format from the server. When the user logs in for the first time, I would like to perform few requests to get data needed for the first run and only after that redirect the user to a certain activity.

How can I "wait" for the Robospice request to finish?

2

There are 2 best solutions below

1
On

You can control the result of your Robospice request on your requestListener, so you should start performing your requests at your onRequestSuccess method of your customRequestListener

0
On

Use something like a CountDownLatch. When it reaches 0, then start your activity.