This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Module | |
public abstract class ActivityContributorModule { | |
@ContributesAndroidInjector(modules = FirstActivityModule.class) | |
abstract FirstActivity contributeFirstActivity(); | |
@ContributesAndroidInjector | |
abstract SecondActivity contributeSecondActivity(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Override | |
protected AndroidInjector<? extends DaggerApplication> applicationInjector() { | |
AppComponent appComponent = DaggerAppComponent.builder().application(this).build(); | |
appComponent.inject(this); | |
return appComponent; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Component(modules = {AndroidSupportInjectionModule.class, AppModule.class}) | |
public interface AppComponent extends AndroidInjector<DaggerApplication> { | |
@Component.Builder | |
interface Builder { | |
@BindsInstance | |
Builder application(Application application); | |
AppComponent build(); | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Component(modules = {AndroidSupportInjectionModule.class, AppModule.class}) | |
public interface AppComponent extends AndroidInjector<DaggerApplication> { | |
@Component.Builder | |
interface Builder { | |
@BindsInstance | |
Builder application(Application application); | |
AppComponent build(); | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Component.Builder | |
interface Builder { | |
@BindsInstance | |
Builder application(Application application); | |
AppComponent build(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Component(modules = {AndroidSupportInjectionModule.class, AppModule.class}) | |
public interface AppComponent extends AndroidInjector<DaggerApplication> { | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Component(modules = {AppModule.class}) | |
public interface AppComponent { | |
void inject(FirstActivity firstActivity); | |
void inject(SecondActivity secondActivity); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
((MyApplication) getApplication()) | |
.getAppComponent() | |
.build() | |
.inject(this); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ASfs |