I have a created a Settings class annotated with @Singleton. This class is successfully injected in my RoboActivities. However when I try to inject it to a POJO (plain old java object), I get a null pointer exception (i.e. is not injected). This POJO is instantiated in a different thread (I don't know if it is relevant). And one last thing, do I have to explicitly create the default constructor of a class if I want to inject instances of that class?
Thanks for any help,
Thomas
My bad,
The problem was that I wasn't instantiating the POJO that belonged to another class using:
RoboGuice.getInjector(context).injectMembers(this);