问题描述
我想用在标题中提到的库中的一个项目。
不过,无论需要我的活动,从一个特殊的Activity类扩展:在Roboguice的情况下,它RoboAcitivity,它的FragmentActivity为ActionbarSherlock
。ActionbarSherlock扩展兼容性库,这是很好的,因为我还需要使用碎片,项目级S< API级别11。
有没有人成功地做到了这一点?由于Java不支持多重继承(这是一件好事通常情况下),我试图让在ActionbarSherlock项目FragmentActivity来扩展标准活动的RoboActivity代替。但我不能得到它来编译这样。
控制台输出的部分原因是:
[2011-10-15 17点46分31秒 - RetainFragmentTest2] /Users/scythe/JavaLibs/JakeWharton-ActionBarSherlock-a4855d0/library/res/values-v11/abs__styles.xml:170:错误:错误:未发现的资源匹配给定名称:ATTR机器人:标志。
[2011-10-15 17点46分31秒 - RetainFragmentTest2] /Users/scythe/JavaLibs/JakeWharton-ActionBarSherlock-a4855d0/library/res/values-v11/abs__styles.xml:171:错误:错误:未发现的资源匹配给定名称:ATTR机器人:navigationMode。
[2011-10-15 17点46分31秒 - RetainFragmentTest2] /Users/scythe/JavaLibs/JakeWharton-ActionBarSherlock-a4855d0/library/res/values-v11/abs__styles.xml:174:错误:错误:未发现的资源匹配给定名称:ATTR机器人:progressBarPadding。
[2011-10-15 17点46分31秒 - RetainFragmentTest2] /Users/scythe/JavaLibs/JakeWharton-ActionBarSherlock-a4855d0/library/res/values-v11/abs__styles.xml:176:错误:错误:未发现的资源匹配给定名称:ATTR机器人:字幕。
[2011-10-15 17点46分31秒 - RetainFragmentTest2] /Users/scythe/JavaLibs/JakeWharton-ActionBarSherlock-a4855d0/library/res/values-v11/abs__styles.xml:177:错误:错误:未发现的资源匹配给定名称:ATTR机器人:subtitleTextStyle。
[2011-10-15 17点46分31秒 - RetainFragmentTest2] /Users/scythe/JavaLibs/JakeWharton-ActionBarSherlock-a4855d0/library/res/values-v11/abs__styles.xml:173:错误:错误:未发现的资源匹配给定名称:ATTR机器人:titleTextStyle。
我敢肯定有一个更好的办法,但是的工作。
I'd like to use the libraries mentioned in the title in one project.
However, both need my Activities to extend from a special Activity class: in the case of Roboguice it's RoboAcitivity, and it's FragmentActivity for ActionbarSherlock.
ActionbarSherlock extends the compatibility library, which is nice, because I also need to use fragments, and the project level s < API level 11.
Has anyone succeeded in doing this? Since Java does not support multiple inheritance (which is a good thing usually), I tried to make the FragmentActivity in the ActionbarSherlock project to extend RoboActivity instead of the standard Activity. But I can't get it to compile this way.
Part of the console output is:
[2011-10-15 17:46:31 - RetainFragmentTest2] /Users/scythe/JavaLibs/JakeWharton-ActionBarSherlock-a4855d0/library/res/values-v11/abs__styles.xml:170: error: Error: No resource found that matches the given name: attr 'android:logo'.
[2011-10-15 17:46:31 - RetainFragmentTest2] /Users/scythe/JavaLibs/JakeWharton-ActionBarSherlock-a4855d0/library/res/values-v11/abs__styles.xml:171: error: Error: No resource found that matches the given name: attr 'android:navigationMode'.
[2011-10-15 17:46:31 - RetainFragmentTest2] /Users/scythe/JavaLibs/JakeWharton-ActionBarSherlock-a4855d0/library/res/values-v11/abs__styles.xml:174: error: Error: No resource found that matches the given name: attr 'android:progressBarPadding'.
[2011-10-15 17:46:31 - RetainFragmentTest2] /Users/scythe/JavaLibs/JakeWharton-ActionBarSherlock-a4855d0/library/res/values-v11/abs__styles.xml:176: error: Error: No resource found that matches the given name: attr 'android:subtitle'.
[2011-10-15 17:46:31 - RetainFragmentTest2] /Users/scythe/JavaLibs/JakeWharton-ActionBarSherlock-a4855d0/library/res/values-v11/abs__styles.xml:177: error: Error: No resource found that matches the given name: attr 'android:subtitleTextStyle'.
[2011-10-15 17:46:31 - RetainFragmentTest2] /Users/scythe/JavaLibs/JakeWharton-ActionBarSherlock-a4855d0/library/res/values-v11/abs__styles.xml:173: error: Error: No resource found that matches the given name: attr 'android:titleTextStyle'.
I'm sure there's a better way, but this is how I finally got ActionBarSherlock and RoboGuice working in my little app.
这篇关于有没有办法使用Roboguice和ActionbarSherlock在一个项目?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!