Package dagger.android.support
Class AndroidSupportInjection
- java.lang.Object
-
- dagger.android.support.AndroidSupportInjection
-
@Beta public final class AndroidSupportInjection extends java.lang.Object
Injects core Android types from support libraries.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
inject(androidx.fragment.app.Fragment fragment)
Injectsfragment
if an associatedAndroidInjector
implementation can be found, otherwise throws anIllegalArgumentException
.
-
-
-
Method Detail
-
inject
public static void inject(androidx.fragment.app.Fragment fragment)
Injectsfragment
if an associatedAndroidInjector
implementation 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
'sactivity
if it implementsHasAndroidInjector
, and if not - Uses the
Application
if it implementsHasAndroidInjector
.
HasAndroidInjector
, aIllegalArgumentException
is thrown.- Throws:
java.lang.IllegalArgumentException
- if no parent fragment, activity, or application implementsHasAndroidInjector
.
- Walks the parent-fragment hierarchy to find the a fragment that implements
-
-