Eclipse's Organize Imports tool can sometimes lead to hard-to-find problems.(First of all ,of course ,you should make sure your xml files have no errors.
)
For example,if your project doesn't have
R.java generated (which might happen because there's and earlier problem with one of
the XML resources ),then Organize Imports will import the
android.R class.This other R class is part of the Android framework and has the same name as your local R class, making it hard to notice. So,if you have many compilation errors around you references to R resources ,check that
android.R is not imported.