最近在研究dagger2 ,但是弄来弄去就是不能自动生成代码,搞的没有头绪,有没有哪位大神帮忙看一下
这个是Component@Singleton
@Component(modules= AppMoudle.class)
public interfaceAppComponent {
voidinject(App application);
ApplicationgetApplication();
DbManagergetDbManager();
SpfManagergetSpfmanager();
}
这个是Module
@Module
public class AppMoudle {
private final Application application;
public AppMoudle(Application application){
this.application=application;
}
@Provides
@Singleton
Application getProvidesApplication(){
return application;
}
@Provides
@Singleton
DbManager getProvidesDbManager(){
return new DbManager(application);
}
@Provides
@Singleton
SpfManager getProvidesSpfManager(){
return new SpfManager(application);
}
}
编译过后还是没有生成代码,有没有大神看一下