无法使用 Eclipse 编辑 R.java Android
我是安卓新手。我面临的问题是我有两种布局。一个是main.xml,另一个是我制作的relative_layout.xml。
我没有给它一个@+id/这个布局,所以默认的id是relative_layout01.xml,但是当我给这个id时,旧的仍然保留在我的R.java中,当我编辑R.java时,它再次生成旧的文件的版本。
我想删除relative_layout01.xml 引用,因为它不存在,因为我已经为布局指定了名称。
附加图像以供参考。
I am new to Android. Well the problem I am facing is that I have two layouts. One is main.xml and another that I made was relative_layout.xml.
I did not give it an @+id/ to this layout so the default id was relative_layout01.xml but when I gave this an id the old one still remain in my R.java and when I edit R.java it again generated the old version of file.
I want to delete relative_layout01.xml reference as it does not exists as I have given a name to my layout.
Attaching an image for reference.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
R.java 应该会自动刷新。
也许您在代码中仍然有一些对它的引用 (setContentView(R.relative...) 或者您仍然将它作为 AndroidManifest.xml 中的活动?
抱歉,我的回答很菜鸟。只是我的 2 美分..
R.java should be refreshed automatically.
Maybe you still have some references to it in your code (setContentView(R.relative...) or you still have it as an activity in AndroidManifest.xml?
Sorry for the noobish answer. Just my 2 cents..
彻底删除import android.R、R.java,重建就可以了
Delete import android.R, and R.java completely, rebuild and it would be fine