In RxJava, I have an object Subscriberthat I subscribe to Observable. Later (some time after the call onComplete()) I create a new one Observableand sign up with the same instance Subscriberthat was used previously. However, this does not seem to work. Is the subscriber inaccessible for reuse?
Example:
class Loader extends Subscriber<T> {
public void load(){
Observable.just("Foo").subscribe(this);
}
public void onComplete(){
}
}
In my code, I would like to create an instance Loaderonce and call it load()several times, for example, after the user clicks the refresh button ...
source
share