Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
public class MyApplication extends Application implements HasActivitySubcomponentBuilders {
@Inject
Map<Class<? extends Activity>, ActivityComponentBuilder> activityComponentBuilders;
private AppComponent appComponent;
public static HasActivitySubcomponentBuilders get(Context context) {
return ((HasActivitySubcomponentBuilders) context.getApplicationContext());
}
@Override
public void onCreate() {
super.onCreate();
appComponent = DaggerAppComponent.create();
appComponent.inject(this);
}
@Override
public ActivityComponentBuilder getActivityComponentBuilder(Class<? extends Activity> activityClass) {
return activityComponentBuilders.get(activityClass);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment