123

Dagger2:Scope, Component间依赖和subComponent - 简书

 6 years ago
source link: http://www.jianshu.com/p/23d00c0aaa20?
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
在上一篇文章(http://www.jianshu.com/p/f56d5b7e8b4d)中,我们接触到了Dagger2的基本用法。然而在实际Android开发当中,还会有更进一步的需求:需要有多个不同生命周期的多个Component,例如,有些依赖图是全局单例的,而有些依赖图会与Activity/Fragment同周期,或者有些依赖图是要与用户登录同周期。在这些情况下,我们就需要自定义Sc...

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK