Hi, I am trying to migrate the company app to dagg...
# android
j
Hi, I am trying to migrate the company app to dagger 2.10 and the
AndroidInjector.inject
method, but I think I found a problem. The app uses custom scopes… like the feature Login has 3 Activities and one LoginModule that is responsable for sharing singletons that only should live in this scope. So in the first Activity I used to execute something like:
Copy code
public class LoginActicity extends AppCompatActivity{
public void onCreate(Bundle bla){
LoginActivityComponent activityComponent = ((CustomApplication) getApplicationContext())
                .plus(new LoginModule()) // generates LoginComponent and save the reference in the CustomApplication
                .plus(new LoginActivityModule(this));
        activityComponent.inject(this);
      ...
}
In the others activities I just execute
((CustomApplication) getApplicationContext()).getLoginComponent().plus(new ForgetPasswordModule()).inject(this)
How can I archive the same behavior when using AndroidInjector ?