Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question about AppComponent.java #10

Open
davida5 opened this issue Dec 20, 2017 · 1 comment
Open

Question about AppComponent.java #10

davida5 opened this issue Dec 20, 2017 · 1 comment

Comments

@davida5
Copy link

davida5 commented Dec 20, 2017

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);
@badoualy
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants