Add support for injecting android.app.Service classes. AndroidInjection supports injection into Activity and Fragment classes, but not Service classes. Just like Activity and Fragment, Service classes are components created by the Android framework, as opposed to classes created by application code.
Thanks for the feedback. This is on our roadmap and we hope to have it soon.
Just to be clear - Service injection is as straightforward as Activity injection, identical approach.
Yup :) we were starting off with just Activities and Fragments as those have the highest value and we wanted to make sure we didn't miss anything with the API. Services (and BroadcastReceivers) will come shortly!
Perhaps you can convince the Android framework team to add BroadcastReceiver.getApplication() to make it less hacky for O? :)
The BroadcastReceiver.onReceive() method has a Context, I think that's totally fine to use and better than waiting for a feature in O.
The BroadcastReceiver.onReceive() method has a Context, I think that's totally fine to use and better than waiting for a feature in O.
I just think it's a good opportunity - I'd say Dagger is a strong argument to try and get the method added to BroadcastReceiver; from an API design perspective I feel it should've been there from the start for all Android component types (except maybe ContentProvider).
Most helpful comment
Yup :) we were starting off with just Activities and Fragments as those have the highest value and we wanted to make sure we didn't miss anything with the API. Services (and BroadcastReceivers) will come shortly!