我在rxjava1中这么写没有问题的,在rxjava2中我应该怎么写
光阴似箭催人老,日月如移越少年。
雷雷
RxJava 2 具有多个基类,您可以在以下位置发现运算符:
io.reactivex.Flowable :0..N 个流,支持 Reactive-Streams 和背压io.reactivex.Flowable : 0..N flows, supporting Reactive-Streams and backpressure
io.reactivex.Flowable
io.reactivex.Observable: 0..N flows, no backpressure
io.reactivex.Observable
io.reactivex.Single: a flow of exactly 1 item or an error
io.reactivex.Single
io.reactivex.Completable: a flow without items but only a completion or error signal
io.reactivex.Completable
io.reactivex.Maybe
雷雷
RxJava 2 具有多个基类,您可以在以下位置发现运算符:
io.reactivex.Flowable
:0..N 个流,支持 Reactive-Streams 和背压io.reactivex.Flowable
: 0..N flows, supporting Reactive-Streams and backpressureio.reactivex.Observable
: 0..N flows, no backpressureio.reactivex.Single
: a flow of exactly 1 item or an errorio.reactivex.Completable
: a flow without items but only a completion or error signalio.reactivex.Maybe
io.reactivex.Observable
:0..N 流,无背压 🎜🎜io.reactivex.Single
:恰好有 1 项的流程或错误🎜🎜 🎜🎜io.reactivex.Completable
:没有项目但只有完成或错误信号的流程🎜🎜 🎜🎜io.reactivex.Maybe
:没有项目、只有一个项目或错误的流程🎜🎜 🎜 🎜取消订阅可以尝试 RxLifecycle https://github.com/trello/RxL...,使用起来很方便。🎜