@Beta public final class AndroidInjection extends Object
| Modifier and Type | Method and Description |
|---|---|
static void |
inject(Activity activity)
Injects
activity if an associated AndroidInjector.Factory implementation can be
found, otherwise throws an IllegalArgumentException. |
static void |
inject(Fragment fragment)
Injects
fragment if an associated AndroidInjector.Factory implementation can be
found, otherwise throws an IllegalArgumentException. |
public static void inject(Activity activity)
activity if an associated AndroidInjector.Factory implementation can be
found, otherwise throws an IllegalArgumentException.RuntimeException - if the Application doesn't implement HasDispatchingActivityInjector, or if no AndroidInjector.Factory<Activity, ?> is
bound for activity.public static void inject(Fragment fragment)
fragment if an associated AndroidInjector.Factory implementation can be
found, otherwise throws an IllegalArgumentException.
Uses the following algorithm to find the appropriate DispatchingAndroidInjector<Fragment> to inject fragment:
HasDispatchingFragmentInjector, and if none do
fragment's activity if it implements
HasDispatchingFragmentInjector, and if not
Application if it implements HasDispatchingFragmentInjector.
HasDispatchingFragmentInjector, a IllegalArgumentException is thrown.IllegalArgumentException - if no AndroidInjector.Factory<Fragment, ?> is bound
for fragment.Copyright © 2012���2017 The Dagger Authors. All rights reserved.