简单地说,我有这个代码。但是最后DoDo永远不会被称为Observable.zip ......为什么?
Observable<Integer> observable1 = Observable.just(1);
Observable<Integer> observable2 = Observable.just(2);
Observable<Double> observable = Observable.zip(
observable1,
observable2,
(Func2)(t1,t2)->{return (double)t1/(double)t2;}
);
observable.finallyDo(()-> {Log.e("","Done");});//is never called;
observable.subscribe(observer);
答案 0 :(得分:4)
Observable
不使用Builder模式,因此您应该订阅从finallyDo()
返回的实例:
observable.finallyDo(()-> {Log.e("","Done");}).subscribe()