I am trying to run Android sample applications using intellij idea and R.Java file is missing form notepad samples source directory.
Make sure you have the right settings: project structure -> Facets -> Android -> yourproject -> compiler
Check compile resources by IDE and Regenerate R.java when resources are changed.
This stole most of my morning, hopefully I'll save someone else some time:)