Example code:
setContentView(R.layout.main);
Error:
R cannot be resolved
There\'s this error in all the class
1) Delete your Gen folder (It will be automatically created afterwards).
2) Clean you project.
See the miracle. :)