Skip to content

Instantly share code, notes, and snippets.

@lukaspili
Created March 3, 2015 22:54
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 lukaspili/348fd86a47a3df7cc55e to your computer and use it in GitHub Desktop.
Save lukaspili/348fd86a47a3df7cc55e to your computer and use it in GitHub Desktop.
public class DemortarApp extends Application {
private DataAccessComponent component;
public static DemortarApp getDemortarApp(Context context) {
return (DemortarApp) context.getApplicationContext();
}
@Override
public void onCreate() {
super.onCreate();
User loggedUser = new User(); // get logged user
component = Dagger_DataAccessComponent.builder()
.apiModule(new ApiModule(loggedUser))
.databaseModule(new DatabaseModule())
.build();
}
public DataAccessComponent getComponent() {
return component;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment