The only way to cancel RxJava Observable is to unsubscribe. RxJavaCallAdapter delegates cancellation to okhttp client.
So you just do something like this:
Subscription subscription = getObservable().subscribe();
Here you can check the code here . Specifically, these lines, if the code
final Call<T> call = originalCall.clone(); // Attempt to cancel the call if it is still in-flight on unsubscription. subscriber.add(Subscriptions.create(new Action0() { @Override public void call() { call.cancel(); } }));
source share