In the Google group Android Beginners I frequently see messages that ask what the error "r cannot be resolved" means in Eclipse.
Eclipse generates the file
R.java for you using the aapt tool (Official Guide to the Android Asset Packaging Tool).
R.java contains a mapping to all the resources your application will use. Note that you should have the
Build Automatically option under the
Project menu checked on.