I use Retrofit with RxAndroid to handle couple of requests in one Activity,
So I have couple subscription variables in the activity as public,
public Subscription sub1;
public Subscription sub2;
public Subscription sub3;
public Subscription sub4;
public Subscription sub5;
now in the onStop of the activity I want to cancel them all (if they did not finish).
Is there any way that we can cancel or unsubscribe all of them at once ?
You can add them into a CompositeSubscription and unsubscribe it in onStop.
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