Search code examples
androiddagger-2dagger

How to reuse Dagger Module


mNetComponent = DaggerNetComponent.builder() 
            .appModule(new AppModule(this))
            .build();

signInComponent= DaggerSignInComponent.builder()
            .appModule(new AppModule(this))
            .build();

This is how i am building my components but is it possible to reuse the AppModule created in DaggerNetComponent on DaggerSignInComponent


Solution

  • I was having trouble with using dependency because of singleton and also i was using modules which caused troubles. took the youtube tutorial https://www.youtube.com/watch?v=-Xk1LNrjarw&list=PLuR1PJnGR-Ih-HXnGSpnqjdhdvqcwhfFU&index=6