Skip to content

Instantly share code, notes, and snippets.

@matzuk
Created January 22, 2017 18:34
Show Gist options
  • Save matzuk/7ad6730714f3015d1cbfd17e944e2367 to your computer and use it in GitHub Desktop.
Save matzuk/7ad6730714f3015d1cbfd17e944e2367 to your computer and use it in GitHub Desktop.
1
public class MyApplication extends Application {
@Nullable
private AccountComponent accountComponent;
@NonNull
public AccountComponent getAccountComponent(String account) { // конкретный аккаунт
if (accountComponent == null) {
accountComponent = Dagger.... // init
}
return accountComponent;
}
public void resetAccountComponent() {
accountComponent = null;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment