Giter VIP home page Giter VIP logo

Comments (2)

RuffianZhong avatar RuffianZhong commented on May 13, 2024

@tmyzh13
lifecycle.bindUntilEvent(event) 这个event是可以是ActivityEvent.STOP,ActivityEvent.DESTORY,,,等
这时候RX的所做的操作就是在event指定的生命周期取消网络请求 DESTORY=》onDestroy()

LifeCycleListener这个回调接口,可能是命名让人误解了,其实我的初衷是,为了在activity/fragment的生命周期中对 presenter 引用着的view和activity做释放 ,可以查看BasePresenter<V, T> 中对LifeCycleListener的实现。。。

from rx-mvp.

tmyzh13 avatar tmyzh13 commented on May 13, 2024

谢谢你的答复,我可以这么理解吗 lifecycle.bindToLifecycle()自动管理按其实一般是activity的ondestroy这个阶段结束了rx的请求(这个应该与Dispose 这个关闭通道不重复吧,结束生命周期之后是不发送了,关闭通道是不接受但是还在发送) 然后用lifecycle.bindUntilEvent(event) 这个event就是在指定的周期去结束。lifeCycleListener你说为了在activity/fragment的生命周期中对 presenter 引用着的view和activity做释放,其实对于lifecycle.bindToLifecycle()就是在activity的onDestroy里面去让presenter做一些解绑操作,我自己最近在学习mvp并且尝试搭建 也看过你写的借鉴了异常的封装 你可以帮我看看有没有什么问题吗https://github.com/tmyzh13/MvpDemo/tree/master/app/src/main/java/com/example/issuser/mvpdemo/dagger_mvp_test/testthrea 这部分是最新运用了mvp的逻辑页面

from rx-mvp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.