I am trying to run Android sample applications using intellij idea and R.Java file is missing form notepad samples source directory.
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...