Bart Burg Bart Burg - 1 month ago 27
Android Question

How does Android Volley handle temporarily loss of network connection?

If an Android Volley post request fails due to network loss, will Android Volley retry the post after the network connection is restored automatically? Will it fire all of the request attempts, wait for connection to be reestablished or simply trigger an error and stop?

If Android Volley doesn't retry after a connection is reestablished, it seems I will have to create logic so that I have an extra queue for whenever the connection gets lost, and that will retry whenever connection state changes.

Answer

If an Android Volley post request fails due to network loss, will Android Volley retry the post after the network connection is restored automatically?

No, it won't. I might not even be desired depending on your application.

Will it fire all of the request attempts, wait for connection to reestablish or simply trigger an error and stop?

It simply throws an error. And yes, you should write this kind of logic yourself.