Rx - How to unsubscribe automatically after receiving onNext()? : <p>How to unsubscribe automatically after receiving onNext() ?</p>

<p>For now I use this code:</p>

<pre><code>rxObservable
.compose(bindToLifecycle()) // unsubscribe automatically in onPause() if method was called in onResume()
.subscribe(new Subscriber&lt;Object&gt;() {
     ...
     @Override
     public void onNext(Object o) {
         unsubscribe();
     }
 });
</code></pre>
