Answer the question
In order to leave comments, you need to log in
How to pass variable to DAG using new Dagger 2 API?
As far as I understand, the new Dagger 2 API is needed in order to remove the following code from the onCreate(Activity) and onAttach(Fragment ) methods:
(requireActivity().application as BaseApplication).appComponent.getPreviewComponent()
.create().inject(this)
(requireActivity().application as BaseApplication).appComponent.getDetailComponent()
.create(nasaId,requireContext()).inject(this)
Answer the question
In order to leave comments, you need to log in
If you are talking about Hilt, then you do not need it :) But in principle, here is an example in the migration guide.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question