机器人库项目和活动 [英] android library project and Activities
问题描述
我开发一个Android SDK库。在这个图书馆,我声明和使用的一些活动。现在,我一直在努力,包括在应用程序库中,但我注意到,我必须声明,在应用程序的所有库活动。这是一个非常糟糕的事情,因为在图书馆,我已经包含了很多的活动,开发人员必须复制在自己的应用程序的所有活动。有没有一种解决方案呢?
I'm developing an Android SDK library. In this library I've declared and used some Activities. Now I've tried to include the library in an application but I've noticed that I must declare all the library activities in the app. This is a very bad thing because in the library, I've included a lot of activities and the developer has to copy all the activities in his own app. Is there a solutions to this?
推荐答案
没有,这是该库目前的已知限制。有很多的讨论,在未来修复这个的Android开发社区,但现在是他们是如何做到的库的限制。
No, this is a known limitation of the libraries at the moment. There is a lot of discussion in the android development community of fixing this in the future, but for now it is a limitation of how they do libraries.
从 DOC
在的清单文件
应用程序项目,必须添加
所有组件的声明说
该应用程序都将使用
从库项目导入。对于
例如,您必须声明任何
<活性GT;
,<服务>
,<接收器>
,
<供应商>
,等等,以及
<许可>
,<使用库>
,和
相似的元件。
In the manifest file of the application project, you must add declarations of all components that the application will use that are imported from a library project. For example, you must declare any
<activity>
,<service>
,<receiver>
,<provider>
, and so on, as well as<permission>
,<uses-library>
, and similar elements.
此外,出色答卷<一href="http://groups.google.com/group/android-developers/browse_thread/thread/9ab55802c29278a3?pli=1">here由马克·墨菲。
Also, excellent answer here by Mark Murphy.
这篇关于机器人库项目和活动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!