Res folder in a library project
I have a couple of projects that use one common library project for shared code. I'd like to be able to put layouts, strings, etc into the common project, but开发者_Python百科 the compiler is not recognizing the res folders, so I can't use R. Is it possible to put layouts, etc into a library project, or am I going to have to copy them to both concrete projects?
Is it possible to put layouts, etc into a library project
Yes. In fact, that is the point of the library project.
I'd like to be able to put layouts, strings, etc into the common project, but the compiler is not recognizing the res folders, so I can't use R.
There is something messed up in your library project, or the project that is including the library. When you build the project that is including the library, it will resolve all R.
references in the library's source code.
Here is a sample project consisting of an Android library project with a demo/
subproject that references and uses the library.
精彩评论