进口com.android.internal.R不能得到解决 [英] The import com.android.internal.R cannot be resolved
问题描述
你好我工作用手势,我需要进口,但即时得到错误
Hi i am working with Gestures and i need to import but i m getting error
com.android.internal.R;
进口com.android.internal.R解决不了
好心帮我,请
推荐答案
你不说为什么你需要访问 com.android.internal.R
,但可悲的事实是,你根本无法将其导入(内部是一个线索,这不是公共API的一部分)。谷歌不公开,因为这是随时可能更改。
You don't say why you need access to com.android.internal.R
, but the sad fact is that you simply cannot import it (the "internal" is a clue that it's not part of the public API). Google doesn't expose this because it is subject to change.
这是可能通过调用才能到内部资源 Resources.getSystem()
。为了得到一个特定的资源标识符的值,你必须知道它的名字,然后用code像下面找到该值:
It is possible to get to the internal resources by calling Resources.getSystem()
. To get the value of a particular resource identifier, you have to know its name and then use code like the following to find the value:
Resources res = Resources.getSystem();
int id = res.getIdentifier("resource name", "resource type", "android");
请注意,您使用的Android未来的版本可能会消失任何名称。
Be aware that any name that you use could disappear in future versions of Android.
这篇关于进口com.android.internal.R不能得到解决的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!