Can anyone tell me what is actually 'View Injection' in Android? What is happening when we use View injection library like ButterKnife and inject views?
PS: I know how to use Butterknife I only want to know how to answer if someone ask me what is View Injection in Android.
ButterKnife is a library for using annotations in place of boilerplate code that we all do over and over again.
View injection is a concept in the MVC/MVVM design patterns that's all about decoupling the Views from their respective Controllers/View-Models.
Here is a very good explanation + example: http://www.developmentalmadness.com/2009/10/15/mvvm-with-prism-101-ndash-part-3b-view-injection-and/
With respect to ButterKnife, I don't know if it does much more than save you the need for fineViewById
, but I haven't used ButterKnife yet so maybe I'm just not familiar with its capabilities.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With