Android的 - 设置Roboguice 2.0? [英] Android - Setting up Roboguice 2.0?
问题描述
我开始了一个新的项目(在Eclipse中的经典),加入 roboguice-2.0.jar
吉斯-2.0-NO-aop.jar
和 jsr305-1.3.9.jar
来我的项目,我的构建路径。
I started a new project (In Eclipse classic), added roboguice-2.0.jar
guice-2.0-no-aop.jar
and jsr305-1.3.9.jar
to my project and my build path.
第一步是扩展RoboApplication,但是蚀找不到匹配软件包这一类。我看了看源和包roboguice是 roboguice.application.RoboApplication
不存在。
有下roboguice在我的项目不适用。
The first step is to extend RoboApplication, but eclipse cannot find the matching package for this class. I looked at the source and the package for roboguice is roboguice.application.RoboApplication
which does not exist.
There is no application under roboguice in my project.
我在想什么?
推荐答案
所以,令人沮丧的roboguice图书馆的发展具有的超过了它的文档。有新libary没有RoboApplication类。
So, frustratingly, the roboguice library development has outpaced its documentation. There is no RoboApplication class in the new libary.
相反,你应该删除该文件,并创建一个指向您的自定义ROBO模块中的值的roboguice.xml文件:
Instead you should remove that file and create a roboguice.xml file in your values that points to your custom robo module:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string-array name="roboguice_modules">
<item>com.mypackage.MyModule</item>
</string-array>
</resources>
此外,如果你正在使用AbstractAndroidModule或RoboModule为你的模块code它现在被称为AbstractModule。
Also if you were using AbstractAndroidModule or RoboModule for your module code it is now called AbstractModule.
这篇关于Android的 - 设置Roboguice 2.0?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!