Android automatically generates a R.java file in development, which is automatically generated and is best not to be changed. But sometimes, this Java file will play Hide-and-seek with us, the r.xx.xxx in the program will appear error.
1. right mouse click on the project to choose Build Project, R.java file back again. Such r.xx.xxx can be read out.
If not, try the second method.
2. Choose eclipse/myeclipse 's clean so R file will also appear.
If it's not, try the third kind.
3. through the above two methods do not use the trick from other projects to copy a copy of the R.java file and then String.xml in a casual change can update r file
If you still can't, try the fourth kind.
4. after the above 3 methods are not enough to explain our project has a good check it
For example resource resources in the file naming, example Result.xml, if written result_main.xml is wrong to need all lowercase
5. If the above four options are not feasible, I also encountered a similar problem in the development, but the above scheme did not give me the right hint, I was so resolved:
First check to see if the SDK is up to date, so I turned on the Android SDK Manage in Eclipse, and I found out that I had to update all the packages that needed to be updated, and then turn off the Android SDK after the update. Manager and then reopen it to find that the manager will perform a series of refresh actions, and all status becomes installed, which indicates that the SDK is up to date and that the R file is already under the Gen directory.