You probably instantiate B somewhere yourself (new B()
) and then you need to call the Injector manually.
When RoboGuice creates the instance B it will automatically inject the dependency A, but when you create B yourself, RoboGuice wil not know about it and you have to call the inject code yourself. This can be done by calling:
RoboInjector injector = RoboGuice.getInjector(context);
injector.injectMembersWithoutViews(yourObjectB);