I've figured it out using Roboguice Modules - http://knowledge.lapasa.net/?p=986
How to use Roboguice to inject subclasses?
-
01-07-2022 - |
Frage
Documentation on this is hard to come by. This is an advance use of Roboguice involving libraries.
Say I have a class in my base library called MyRoboActivity which extends from RoboActivity
@Inject
HumanModel humanModel;
In one project for men just say, I would like the above to be populated with this version
@Singleton
public class MaleModel extends HumanModel {...}
In another project for women, I would the above to be injected with this version
@Singleton
public class FemaleModel extends HumanModel {...}
What syntax do I need in each male and female projects to make this work?
Lösung
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow