G
G
geop2015-10-24 00:01:33
Java
geop, 2015-10-24 00:01:33

How not to lose an asynchronous retrofit request when the screen is flipped?

There is an activity, I execute a request in it, while the request is being executed, the progress bar is visible, then at the end of the callback I make it invisible. How to not reload the data during the flip (ie the progressbar should be immediately invisible) and not create a new request if the flip was during the execution of the request?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey, 2015-10-24
@geap

You make a request in an activity, and after the screen is rotated, it is destroyed and re-created. Therefore, the request that you sent from the first activity will return to nowhere. Read an interesting article on this topic, it just touches on this problem.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question