-
Notifications
You must be signed in to change notification settings - Fork 129
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
Dose this support a kotlin android project? #22
Comments
@baishuai Yes Here is an example: @FragmentView(presenter = MyPresenter::class)
class MyFragment : BaseFragment(), MyPresenter.View {
@Inject
@Presenter
lateinit var presenter: MyPresenter
}
class MyPresenter @Inject constructor(val repo: SomeRepository) : AbstractPresenter<MyPresenter.View>() {
interface View
} |
Thanks. @SaeedMasoumi I have already tried like your example. The dagger works ok before I use Have you ever fall into this problem? |
@baishuai No, Maybe there is a problem with your dagger's component to provide the presenter or you invoke your presenter too early (before This is my approach to provide a presenter:
@Subcomponent(modules = MyModule.class)
@PerFragment
interface MyComponent {
void injectTo(MyFragment fragment);
}
class MyPresenter @Inject constructor(....
appComponent.plus(MyModule()).injectTo(this)
|
Now it works. I have used presenter too early. Thanks very much! |
No description provided.
The text was updated successfully, but these errors were encountered: