In fact, Android itself maintains this public final class R class is mainly with new resource files, this R.java without us to modify, if you do not understand do not modify it, it defines each resource value is unique, does not conflict with the system. This file is automatically updated by the ADT plugin, which is automatically updated when you edit the res file and save it.
R.java typically include attr, drawable, IDs, Raw, Layout, string, and XML, depending on the resources you use for the project. When a R.java file is lost, it needs to be rebuilt, but there may be some problems, such as a resource not being updated automatically.
Solve
- The Clean,r file that you select Eclipse-MyEclipse will appear.
- Click the right mouse button on the project and choose Build Project, and R.java will reply. This makes it possible to automatically complete the resource that the r file points to in the program.
- Copy an R file from another project, and then string.xml to change it, clean it, and update the R file.
- If none of the above steps are possible. It may be an error caused by the project itself, such as the naming of files in the Resoure resource, such as Result_main.xml, if written result_main.xml is wrong, the resource file name requires all lowercase.
Through this article hope to help everyone, find R file, thank you for the support of this site!