Skip to content

Instantly share code, notes, and snippets.

@koalahamlet
Created February 3, 2015 21:31
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 koalahamlet/5dd974a42c8672725da6 to your computer and use it in GitHub Desktop.
Save koalahamlet/5dd974a42c8672725da6 to your computer and use it in GitHub Desktop.
package venmo.michaelhuff.sf5dayforecast;
import javax.inject.Inject;
import javax.inject.Singleton;
import dagger.Component;
/**
* Created by koalahamlet on 2/3/15.
*/
public class WeatherApplication extends android.app.Application {
@Singleton
@Component(modules = WeatherAppModule.class)
public interface ApplicationComponent {
void inject(WeatherApplication weatherApplication);
void inject(MainActivity mainActivity);
}
@Inject ApiService apiService;
@Inject ApiClient apiClient;
private ApplicationComponent component;
@Override public void onCreate() {
super.onCreate();
component = Dagger_WeatherApplication_ApplicationComponent.builder()
.androidModule(new WeatherAppModule(this))
.build();
component().inject(this); // As of now, LocationManager should be injected into this.
}
public ApplicationComponent component() {
return component;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment