I know that individual Retrofit requests can be cancelled at any time by simply calling retrofitCall.cancel();
But I need a way to cancel all ongoing requests at once. Is it possible? I haven't found anything like it in the documentation.
You have to keep reference to your shared OkHttpClient.
Than when you want to cancel all requests just call:
client.dispatcher().cancelAll()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With