开发者

Android Library using Main Project Resources

I am creating a library for Android projects.

The activity is declared in the library project, as it will be reusable in different projects. This activity is using images which are project specific. I have added those images in the main project.

How can I access resources from the main proje开发者_如何学Goct in the library?


Put a copy of all relevant resources in the library. It's perfectly legal. If you want to override them in the actual app, you can. If the IDs clash, the end product will use the resources from the app.

EDIT: the alternative is filesystem-level links. On Windows, use mklink to create hardlinks to your resource folders in the project; on *nix, use ln. This may mess up your source control, if any, so proceed with caution.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜