Observable.just(100)
.flatMap(new Func1<Integer, Observable<Long>>() {
public Observable<Long> (Integer integer) {
return Observable.timer(20, TimeUnit.MILLISECONDS);
}
})
.compose(RxHelper.<Long>io_main())
.subscribe(new Subscriber<Long>() {
public void onCompleted() {
}
public void onError(Throwable e) {
}
public void onNext(Long aLong) {
pb.setProgress(aLong.intValue());
}
});
近期评论