0

How to cancel retrofit Response<T> api calls. Like we have a function for Call class. Link: https://square.github.io/retrofit/2.x/retrofit/retrofit2/Call.html#cancel--

But there is no such thing for Response type. Link: https://square.github.io/retrofit/2.x/retrofit/retrofit2/Response.html

pa1pal
  • 743
  • 3
  • 14
  • 32

1 Answers1

0

No, you can't cancel after receive Response<T>

It's result after run execute(), enqueue()

You must use enqueue() and use Call<T>.cancel()

You want cancel Callback, here: How to Cancel Retrofit request