0

My Guice is a little rusty (been 3 years) so bear with me. I have a custom API (@ContextSingleton) object that I need to @Inject into my various classes. This works fine when the target class extends from RoboActivity (or in my case, RoboSherlockActivity). However, when I want to inject it into a POJO, the injection fails and I get a null object.

Am I missing anything here? I tried writing a custom Provider for the API object (returning a new Api()), but the object creation graph isn't complete as any @Inject members within the API object is still null.

Right now I'm working around this by passing in the API object into POJOs instead of injecting it, but I'd like to eventually use @Inject for consistency.

ebernie
  • 820
  • 1
  • 8
  • 13

1 Answers1

0

I have this question, too. I think that we need to just use regular Guice for POJO cases. See my answer here: https://stackoverflow.com/a/24671352/189341

Community
  • 1
  • 1
Kevin
  • 702
  • 7
  • 22