Is there any way to use not public android resourc

2019-01-17 15:23发布

问题:

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.