Package dagger.android.support
Class AndroidSupportInjection
java.lang.Object
dagger.android.support.AndroidSupportInjection
Injects core Android types from support libraries.
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidinject(androidx.fragment.app.Fragment fragment) Injectsfragmentif an associatedAndroidInjectorimplementation can be found, otherwise throws anIllegalArgumentException.
-
Method Details
-
inject
public static void inject(androidx.fragment.app.Fragment fragment) Injectsfragmentif an associatedAndroidInjectorimplementation can be found, otherwise throws anIllegalArgumentException.Uses the following algorithm to find the appropriate
AndroidInjector<Fragment>to use to injectfragment:- Walks the parent-fragment hierarchy to find the a fragment that implements
HasAndroidInjector, and if none do - Uses the
fragment'sactivityif it implementsHasAndroidInjector, and if not - Uses the
Applicationif it implementsHasAndroidInjector.
HasAndroidInjector, aIllegalArgumentExceptionis thrown.- Throws:
IllegalArgumentException- if no parent fragment, activity, or application implementsHasAndroidInjector.
- Walks the parent-fragment hierarchy to find the a fragment that implements
-