A DialogFragment 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.
| 28 | * its members will be injected again. |
| 29 | */ |
| 30 | @Beta |
| 31 | public abstract class DaggerDialogFragment extends DialogFragment implements HasFragmentInjector { |
| 32 | |
| 33 | @Inject DispatchingAndroidInjector<Fragment> childFragmentInjector; |
| 34 | |
| 35 | @Override |
| 36 | public void onAttach(Context context) { |
| 37 | AndroidInjection.inject(this); |
| 38 | super.onAttach(context); |
| 39 | } |
| 40 | |
| 41 | @Override |
| 42 | public AndroidInjector<Fragment> fragmentInjector() { |
| 43 | return childFragmentInjector; |
| 44 | } |
| 45 | } |
nothing calls this directly
no outgoing calls
no test coverage detected