Dont worry. First you may clean the project, then run the project. If this does not work then follow the following links:
- Here is the best way to solve this problem: [Android Development- Where is my R.Java file?][2]
- R.java not regenerating
- R cannot be resolved – Android error
- R cannot be resolved to a variable
- R cannot be resolved to a variable — mailing list entry
- Fixed: R cannot be resolved to a variable