RuffianZhong / Rx-Mvp

RxJava2+Retrofit2+RxLifecycle2+OkHttp3 封装RHttp 使用MVP模式构建项目
348 stars 86 forks source link

取消网络请求这个在哪调用了啊 #3

Closed aiceking closed 7 years ago

aiceking commented 7 years ago

public interface HttpRequestListener { void cancle(); }

RuffianZhong commented 7 years ago

@AndroidCloud 1.手动取消的话参考 https://github.com/RuffianZhong/Rx-Mvp/blob/master/app/src/main/java/com/rx/mvp/cn/test/RetrofitTest.java 2.RxLifecycle2会根据生命周期自动取消网络请求 eg: onCreate(调用)->onStop(取消)