0

I'm in the process of switching my app over from RoboGuice to Dagger. RoboGuice has this nice feature where you can inject native components (@Inject Context mContext gives you a Context object). I was wondering if anyone knew of an extension to Dagger or another DI library that can do this. Thanks!

dlucci
  • 729
  • 4
  • 9
  • 24

2 Answers2

1

According to this thread on the Dagger issues list, you can accomplish this behavior but you need to inject it via a module, as discussed here

dlucci
  • 729
  • 4
  • 9
  • 24
0

Yeah, that's too easy with Dagger, so there is no need in this feature out-of-the box.

Moreover, you can specifically control which context to inject, it's really useful to inject activity context under its scope.

Dmitry Gryazin
  • 933
  • 1
  • 11
  • 24