开发者

Where can I find the android.R.* files?

I am looking for the preset android 开发者_JAVA技巧files that come with the Android os. Can someone direct me to the source?


(Android install path)\android-sdk-windows\platforms\android-version\data\res

Hope this is what you mean.


Call the following as an example:

android.R.*

You can access built-in animations, layouts, text fields, whatever you need.

So if you wanted to find the default android black color, call the following:

View.setBackGroundColor(android.R.color.black);

This returns the INTEGER containing the pointer to the appropriate resource files.

All R files are generated as integer pointers, so this is the proper way to access these resources.

Hope this helped!


Try codesearch from google:

http://google.com/codesearch (choose android on the left side) or directly:

http://google.com/codesearch#cZwlSNS7aEw/frameworks/base/core/res/&exact_package=android


go to gen-> android.support.v7.appcompat ->R.java

Android generated a special called the ‘R’ file. This is a file of constants that allow you to get Java references to the TextView you defined in main.xml In fact, you can get references to all kinds of in app resources you define! But remember the String resources you defined in XML? You can get references to those too.


You mean R.java? It will be in %project root%/res/android/%your project name%/

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜