Skip to content

Instantly share code, notes, and snippets.

@iamBedant
Last active February 5, 2018 16:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iamBedant/5a1a7ab7d0a3b576e2619933f47f2cee to your computer and use it in GitHub Desktop.
Save iamBedant/5a1a7ab7d0a3b576e2619933f47f2cee to your computer and use it in GitHub Desktop.
public class DemoApplication extends Application {
protected ApplicationComponent applicationComponent;
@Inject
DataManager dataManager;
public static DemoApplication get(Context context) {
return (DemoApplication) context.getApplicationContext();
}
@Override
public void onCreate() {
super.onCreate();
applicationComponent = DaggerApplicationComponent
.builder()
.applicationModule(new ApplicationModule(this))
.build();
applicationComponent.inject(this);
}
public ApplicationComponent getComponent(){
return applicationComponent;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment