Back to project page YourConsole.
The source code is released under:
MIT License
If you think the Android project YourConsole listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.akisute.yourconsole.app.dagger; // w ww . j ava 2 s.c o m import android.content.Context; import javax.inject.Singleton; import dagger.Module; import dagger.Provides; @Module(library = true) public class DaggeredApplicationModule { private final DaggeredApplication mApplication; public DaggeredApplicationModule(DaggeredApplication application) { mApplication = application; } @Provides @Singleton @ForApplication Context provideApplicationContext() { return mApplication; } @Provides @ForInjecting Context provideInjectingContext() { if (mApplication.getInjectingContext() == null) { throw new IllegalStateException("Cannot provide injecting context. @ForInjecting Context can only be injected during injections to Daggered Contexts. No Lazy Injections available as well."); } return mApplication.getInjectingContext(); } }