Search code examples
androidguiceroboguice

Using Guice to inject dependencies into an Android activity's constructor


Does anybody know of a way to use Guice to inject dependencies into the constructor of an Activity in Android? It looks like activities normally have only the default constructor so that the platform can easily create a new instance. While it is easy enough to have a singleton to reference the injector and get dependencies that way it is less clean and introduces a bit of static state.

Any suggestions?


Solution

  • I don't know how I missed this!

    https://github.com/roboguice/roboguice