dagger-android-injection
dagger-android-injection copied to clipboard
Question about AppComponent.java
Hi, thanks for an amazing example, I have a question about two lines in the AppComponent.java, see below, what is the purpose of these lines? without these lines the app seems to work fine
void inject(AndroidSampleApp app);
@Override
void inject(DaggerApplication instance);
The second one is useless because it's just a redeclaration of a method in the AndroidInjector interface.
The first one is here useless because the injected fields are in the DaggerApplication
, so the content of inject is generated by looking the DaggerApplication
class, so upcasting the app at runtime by calling this one will work