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 a gen
folder in your project root. If you don't, make one yourself.
Fix all errors appear on .xml files. R.java will be re-appeared
Also make sure to check your imports. Sometimes when your IDE (eclipse & intellij as well) cannot find your generated R class and auto-imports android.R.
import android.R kills everything you are doing in your generated sources!
Cost me 30min of my life...