<Android + Kotlin + Hilt: Cannot @Inject in a non ...
# stackoverflow
u
Android + Kotlin + Hilt: Cannot @Inject in a non activity class I recently started learning Hilt, and for now it's giving me more headaches than happiness, but I like challenges, so let's go to the point. I'm having plenty of problems understanding how to inject in non activity classes, for example to inject a Context or any other class. Most of my non activity classes were objects (singleton) so far, but as I wasn't able to inject into an object I decided to convert them to classes. I'm trying to inject with field injection, because if I use constructor...