收到错误消息和QUOT;资源不公开];不公开、错误、消息、资源

2023-09-06 14:46:53 作者:从别后,忆相逢

所以我尝试使用内置的可绘制timepicker_up_btn的API 7级。这是在SDK中的实际资源的文件夹,我可以用其他资源从该文件夹。但我得到的错误信息资源是不公开的。

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. But I get the error message "Resource is not public".

这似乎是谷歌正试图限制使用这一资源。我想他们不关心,如果我在一个Android应用程序使用它,这让我的应用程序类似于普通的Andr​​oid的整体外观。

It seems like Google is trying to limit the use of this resource. I would think they don't care if I use it in an Android application and it makes the overall look of my application similar to stock Android.

总之,这是可以解决的?我能以某种方式使用非公共资源,而不将其复制到我的项目?什么是处理复制存量资源,以自己的项目?非法?令人难以接受的?还是继续我们不关心?

Anyway, is this fixable? Can I somehow use a non-public resource without copying it to my project? And what is the deal with copying stock resources to own projects? Illegal? Frowned upon? Or go ahead we don't care?

推荐答案

做的最好的事情是将文件复制到我们的应用程序。有人告诉我,一些谷歌员工,你不应该引用的资源,而将它们复制到你的应用程序。

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.

其中的一个原因是,如果你引用了一大堆图标为您的应用程序,你不能保证每一个这些是在同一时间更新时,SDK的新版本发布。你可能最终得到了一些先进的最新花哨的图标和一些旧的:)

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 :)