Is there any way to use not public android resources in my application?

心不动则不痛 提交于 2019-12-17 18:26:05

问题


I need to use the following resources in my widget:

  • pressed_application_background_static
  • focused_application_background_static

I hope that usage of these resources will allow me to have orange background on standard android and green on HTC.

But they are not public, so usage of

android:drawable="@android:drawable/pressed_application_background_static"

is not allowed. Is still there any way to use them?


回答1:


You can reference them like this

android:drawable="@*android:drawable/pressed_application_background_static"

but it is not recommended, because private resources are likely to be renamed or removed in the future.




回答2:


browse the sdk for the drawable and copy it locally to you res/drawable folder. it will probably be an XML file but if you search for "pressed_application_background_static" you should find it without trouble.



来源:https://stackoverflow.com/questions/5685456/is-there-any-way-to-use-not-public-android-resources-in-my-application

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!