这个问题在这里已有答案:
在Android应用程序中,“R.java”的作用是什么? [已关闭] 3个答案我在Eclipse中有一个Android项目。 有一个名为“gen [Generated Java Files]”的文件夹。 这个文件夹来自哪里? 如何控制这里生成的内容? 这个地方有没有这方面的文件? 我试图更改和替换此gen文件夹中的代码和文件,但我似乎无法改变任何东西。 每当我更改内容时,只要保存,文件就会恢复。
This question already has an answer here:
In Android applications what is the role of “R.java”? [closed] 3 answersI have an Android project in Eclipse. There is a folder called "gen [Generated Java Files]". Where does this folder come from? How can I control what is generated here? Is there any documentation for this somewhere? I have tried to change and replace the code and files in this gen folder, but I cannot seem to change anything. Every time I change something, as soon as I save, the files revert back.
最满意答案
R.java是一个在构建时自动生成的文件。 它的内容基于资源文件,例如布局,drawable,样式,首选项等,并且具有提供给资源文件的所有资源ID。
当您删除它时,会使用提供给资源的所有ID重新创建它。
关于Android应用程序中的R.java文件 提供资源 访问资源 资源类型 http://developer.android.com/reference/android/R.htmlR.java is a file autogenerated on build. It's content is based on the resource files, for example layouts, drawables, styles, preferences, etc., and have all the resources ID's provided to the resource files.
When you deleted it, it was recreated with all the ID´s provided to resources.
All about R.java file in android application Providing Resources Accessing Resources Resource types http://developer.android.com/reference/android/R.html更多推荐
发布评论