In RxJava I have a Subscriber
object wich I subscribe on a Observable
. Later on (some time after onComplete()
has been invoked) I create a new Observable
and subscribe with the same Subscriber
instance used before. However, that seems not work. Is a subscriber not reusable?
Example:
class Loader extends Subscriber<T> {
public void load(){
Observable.just("Foo").subscribe(this);
}
public void onComplete(){
// update UI
}
}
In my code I would like to instantiate a Loader
once, and call load()
multiple time, for instance after the user clicks on a refresh button ...