不幸的是,Dagger2没有创建要注入的对象实例。
源代码? Here
组件:
@ActivityScope @Component(dependencies = ApplicationComponent.class,
modules = { HomeModule.class })
public interface HomeComponent {
void inject(HomeActivity homeActivity);
HomePresenter homePresenter();
}
模块:
@Module public class HomeModule {
@Provides @ActivityScope HomePresenter provideHomePresenter(
HomePresenterImpl presenter) {
return presenter;
}
}
答案 0 :(得分:3)
只需将Dagger的版本更新为2.2
。