Reputation: 3605
For native android Async tasks, we had preExecute() method in which we used to show progress dialogs with spinners. Incase of retrofit, where should i put the progress dialog code?
Upvotes: 1
Views: 2646
Reputation: 321
Follow the documentation.
@Override
public void success(String s, Response response) {
// do something with success
}
@Override
public void failure(RetrofitError retrofitError) {
// do something with failure
}
Upvotes: 0
Reputation: 3605
I was already using the success and failure methods. Actually it was quite easy. Just make the progress bar visible on the event that you are calling and then later once the view that you want to show post onsuccess method is visible, put the progress bar visibility to gone.
Upvotes: 1