Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Presenter 怎么注入的,注入对象的来源 #173

Closed
Sum41forever opened this issue Dec 27, 2017 · 5 comments
Closed

Presenter 怎么注入的,注入对象的来源 #173

Sum41forever opened this issue Dec 27, 2017 · 5 comments

Comments

@Sum41forever
Copy link
Contributor

Sum41forever commented Dec 27, 2017

Presenter 怎么注入的 ?

A:Presenter的注入通过Inject方式注入,位置是BaseActivity,类型是泛型 IPresenter及其子类
(因为BaseActivity是抽象类,无法实例化,所以实际是在子实现类中)
qq 20171227114232


Presenter 注入对象的来源 ?

A:以框架中UserPresenter为例子 红色的在UserModule 蓝色的在AppComponent接口实现类DaggerAppComponent
1


userModule

18
114102


AppComponent接口实现类DaggerAppComponent

da
4057

具体Dagger的用法和理解请参考文档:
基础篇:Dagger2 学习
Dagger2 Scope 注解
原理篇:扔物线 Dagger 精解

基础篇是MVVMArms的作者写的,作为基础篇个人感觉不错。就是Scope那个地方说的不清楚,所以加上了第二篇。第三篇是扔物线写的关于Dagger1的原理的,虽然是Dagger1的,但是个人认为该文是了解Dagger的原理,思想的最好的一篇文章。

@JessYanCoding
Copy link
Owner

@LaoXiZi
Copy link

LaoXiZi commented Sep 11, 2018

基础篇:Dagger2 学习 404了

@JessYanCoding
Copy link
Owner

@xiaobailong24

@xiaobailong24
Copy link
Collaborator

xiaobailong24 commented Sep 13, 2018

@WilliamChief
Copy link

@JessYanCoding mPresenter为空时 如何重新注入

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants