@Override public void onCreate() { super.onCreate(); JodaTimeAndroid.init(this); Bugsnag.init(this); Bugsnag.setNotifyReleaseStages("production"); }
@Override public AndroidInjector<ContentProvider> contentProviderInjector() { injectIfNecessary(); return contentProviderInjector; } }
public static void injectSetInjected(DaggerApplication instance) { instance.setInjected(); } }
/** * Lazily injects the {@link DaggerApplication}'s members. Injection cannot be performed in {@link * Application#onCreate()} since {@link android.content.ContentProvider}s' {@link * android.content.ContentProvider#onCreate() onCreate()} method will be called first and might * need injected members on the application. Injection is not performed in the constructor, as * that may result in members-injection methods being called before the constructor has completed, * allowing for a partially-constructed instance to escape. */ private void injectIfNecessary() { if (needToInject) { synchronized (this) { if (needToInject) { @SuppressWarnings("unchecked") AndroidInjector<DaggerApplication> applicationInjector = (AndroidInjector<DaggerApplication>) applicationInjector(); applicationInjector.inject(this); if (needToInject) { throw new IllegalStateException( "The AndroidInjector returned from applicationInjector() did not inject the " + "DaggerApplication"); } } } } }
@Override public void onCreate() { super.onCreate(); injectIfNecessary(); }