2.Dagger2模块化引入

1.Module中includes引入

@Module(includes = {importModule.class})
public class MyModule{
}

2.Component中引入

@Component(modules = {Module1.class,importModule.class})
public interface MyComponent {
}

3.dependence中引入

@Component(modules = {Module1.class},dependencies = ImportComponent .class)
public interface MyComponent {
}

@Component(modules = {importModule.class})
public interface ImportComponent {
}

你可能感兴趣的:(2.Dagger2模块化引入)