Skip to content

Instantly share code, notes, and snippets.

@Philio
Created April 22, 2019 13:08
Show Gist options
  • Save Philio/c9084bf4798c7a3e0a81a4dd5bc0e34d to your computer and use it in GitHub Desktop.
Save Philio/c9084bf4798c7a3e0a81a4dd5bc0e34d to your computer and use it in GitHub Desktop.
public class MyApplication extends DaggerApplication {
@Override
protected AndroidInjector<? extends DaggerApplication> applicationInjector() {
AppComponent appComponent = DaggerAppComponent.create();
BindingComponent bindingComponent = DaggerBindingComponent.builder()
.appComponent(appComponent)
.build();
DataBindingUtil.setDefaultComponent(bindingComponent);
return appComponent;
}
}
class MyApplication : DaggerApplication() {
override fun applicationInjector(): AndroidInjector<out DaggerApplication> {
val appComponent = DaggerAppComponent.create()
val bindingComponent = DaggerBindingComponent.builder()
.appComponent(appComponent)
.build()
DataBindingUtil.setDefaultComponent(bindingComponent)
return appComponent
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment