Android和依赖注入 [英] Android and Dependency Injection
本文介绍了Android和依赖注入的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我一直在四处寻找一些关于在Android开发中使用依赖注入容器的信息。具体来说,如何重写创建一个活动
的方式,当从死机回来(无论什么原因)时也可以工作。
I've been looking around, in vain, for some information on using a dependency injection container in Android development. Specifically, how to override the creation of an Activity
in a way that will also work when coming back from being killed (for whatever reason).
有没有人在这方面有任何经验?
Has anyone got any experience in this area?
推荐答案
看来你可以使用 Google Guice 2.0 。您也可以查看 roboguice 。
It appears you can use Google Guice 2.0 with Android. You might also look into roboguice.
编辑:
Spring是现在也可以用于Android
编辑:
Roboguice现已弃用。您可以在牙签开发人员的评论中提到牙签。
这篇关于Android和依赖注入的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文