Skip to content

Instantly share code, notes, and snippets.

@janishar
Created December 25, 2016 07:50
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 janishar/e20e3364b4265ab56dc4e0d33b3ea025 to your computer and use it in GitHub Desktop.
Save janishar/e20e3364b4265ab56dc4e0d33b3ea025 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