简体   繁体   English

Android ADT-Eclipse | 在视图/布局文件中编辑或添加ID时不要更改R.java

[英]Android ADT - Eclipse | Dont changes R.java when editing or adding Ids in views / layout files

My problem is above. 我的问题在上面。

If i try to change a view object Id (for example a TextView) inside a Layout file, nothing happens inside the R.java file, so i can't appeal to my TextView inside an Activity. 如果我尝试在Layout文件中更改视图对象ID(例如TextView),则R.java文件内部什么也没有发生,因此我无法在Activity中吸引我的TextView。 I don't know what happend, because i did not changed anything in Eclipse or something. 我不知道发生了什么,因为我没有在Eclipse中进行任何更改。

I also tried this in a New Android Application Project and inside of this new Project i did not had this Problem. 我也在一个新的Android应用程序项目中尝试过此操作,在这个新项目中,我没有出现此问题。 Maybe i changed a setting inside my main project or something. 也许我更改了主项目中的设置或其他内容。

Do someone could give my a Tipp or have an idea? 有人可以给我小费还是有个主意?

Sometimes Eclipse is buggy with R files. 有时Eclipse的R文件存在错误。 Try saving, then closing your android project, reopening, and cleaning your project. 尝试保存,然后关闭您的android项目,重新打开并清理您的项目。 Make sure it's set to build automatically. 确保将其设置为自动生成。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM