For example I reference android styles with…
@android:style/...
and my own apps styles with…
@style/...
but how can I separate my styles into other names packages? e.g.
@somePackage:style/...
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Unfortunately you can’t. You might think that Android Libraries might help you, but this is not the case. That’s because Android Libraries are “physically” merged into main application when resources are compiled.
So from
aaptpoint of view, your application’s resources are indistinguishable from any other Android Library resources. Even more,aaptreceives multiple resources directories as input (i.e. path toresfor application, plus paths to allresdirectories from references Android Libraries), but at the same time only singleAndroidManifest.xmlfrom application is passed as the “owner” of these resources.What I want to say, is that even though you can logically group resources (such as styles) into separate Android Libraries, you still can’t reference them using these Android Libraries’ package names. Only using main application’s package name.
For example, you have application with package name
com.test.appand Android Library withcom.test.lib. And the library contains styletestStyle.The following doesn’t work (and there is theoretically nothing that can help you to workaround this):
While this works fine: