如何在Eclipse中的Android项目中生成R.java?(how is R.java generated in an Android project in Eclipse? [duplicate

编程入门 行业动态 更新时间:2024-10-26 04:30:35
如何在Eclipse中的Android项目中生成R.java?(how is R.java generated in an Android project in Eclipse? [duplicate])

这个问题在这里已有答案:

在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 answers

I 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.html

R.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

更多推荐

本文发布于:2023-08-04 04:30:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1410200.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:项目   如何在   Android   Eclipse   duplicate

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!