Dagger 2 Tutorial Part 3 - FIELD INJECTION - Android Studio Tutorial
Автор: Coding in Flow
Загружено: 2018-12-24
Просмотров: 89375
Описание:
In part 3 of the Dagger 2 tutorial, we will learn how to do field injection. By annotating a non-private, non-final member variable with @Inject, we tell Dagger to set its value by referencing it directly. Field injection is mainly used to inject variables into Android framework types that the system instantiates and on which we can't do constructor injection, like activities, BroadcastReceivers and fragments.
To trigger the injection process on an already instantiated object (like an activity), we have to create and call a members-injection method in our component that takes this particular class as an argument.
Watch the whole playlist:
• Плейлист
Example code for this part:
https://gist.github.com/codinginflow/...
____________________
💻 Find the BEST programming tutorials on TutHub:
https://tuthub.io
⭐ Get my MVVM Caching Course now:
https://codinginflow.com/caching
❗ Subscribe to the channel:
/ codinginflo. .
📨 Subscribe to the Coding in Flow newsletter:
https://codinginflow.com/newsletter
❓ Join our free developer community:
/ discord
📣 Follow Coding in Flow on other sites:
Facebook: / codinginflow
Instagram: / codinginflow
TikTok: / codinginflow
Twitter: / codinginflow
Github: https://github.com/codinginflow
💰 Business requests, sponsoring, etc.: [email protected]
Повторяем попытку...
Доступные форматы для скачивания:
Скачать видео
-
Информация по загрузке: