Getting error message “Resource is not public”

后端 未结 3 1681
梦谈多话
梦谈多话 2020-12-18 18:46

So I\'m trying to use the built-in drawable timepicker_up_btn for api level 7. It is in the actual res folder in the sdk, and I can use other resources from that folder. B

相关标签:
3条回答
  • 2020-12-18 19:21

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

    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.

    0 讨论(0)
  • 2020-12-18 19:25

    Technically you can copy the resource from SDK folder to your own resource folder and then use it as your own. Though I am not sure whether it's a violation of the copyright.

    0 讨论(0)
  • 2020-12-18 19:38

    The best thing to do is to copy the files to our application. I was told by some Google employees that you should not reference the resources, rather copy them to your application.

    One of the reasons for this is that if you reference a whole bunch of icons for your application, you are not guaranteed that every one of these is updated at the same time when new versions of the SDK is released. You might end up with some up-to-date fancy icons and some old ones :)

    0 讨论(0)
提交回复
热议问题