A Fragment that injects its members in #onAttach(Context) and can be used to inject child Fragments attached to it. Note that when this fragment gets reattached, its members will be injected again.
| 27 | * members will be injected again. |
| 28 | */ |
| 29 | @Beta |
| 30 | public abstract class DaggerFragment extends Fragment implements HasFragmentInjector { |
| 31 | |
| 32 | @Inject DispatchingAndroidInjector<Fragment> childFragmentInjector; |
| 33 | |
| 34 | @Override |
| 35 | public void onAttach(Context context) { |
| 36 | AndroidInjection.inject(this); |
| 37 | super.onAttach(context); |
| 38 | } |
| 39 | |
| 40 | @Override |
| 41 | public AndroidInjector<Fragment> fragmentInjector() { |
| 42 | return childFragmentInjector; |
| 43 | } |
| 44 | } |
nothing calls this directly
no outgoing calls
no test coverage detected