Last active
November 7, 2017 19:15
-
-
Save rachitmishra/2a5aed206a2e2d3c810fc495a9f68de1 to your computer and use it in GitHub Desktop.
dagger-android-activity-fragment
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* An activity implementing `HasSupportFragmentInjector` and with an instance of `DispatchingAndroidInjector<Fragment>` | |
* for fragment injection. | |
*/ | |
class HomeActivity : HasSupportFragmentInjector { | |
@Inject | |
lateinit var mAndroidInjector: DispatchingAndroidInjector<Fragment> | |
@Override | |
public AndroidInjector<Fragment> supportFragmentInjector() { | |
return mFragmentInjector; | |
} | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
AndroidInjection.inject(this); // Call before super! | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment