I created a new xml file, and had an errant ? in it that prevented R.java from regenerating. I tried Cleaning the Project, and Fixing the Project Properties but no luck.

Then I realized the XML was creating the R.java from recreating itself, so I deleted the XML file and the R.java was back.

Now though, I am getting an error on all the calls to R.*.* calls saying that :

* cannot be resolved or is not a field

So, for instance I have 

```
setContentView(R.layout.detectlayout);

```

ERROR: detectlayout cannot be resolved or is not a field

for all of my calls to 'R.'. Any ideas?

I have tried all of the suggestions on SO already to no luck =/
['https://Stackoverflow.com/questions/4211509', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/496686/']
Look at the 'import' section of your code. Since you deleted your original R, chances is Eclipse help you to fill in the R as com.android.R instead of com.yourproject.R

I also sometimes have problem in Eclipse Resource stuff, sometimes I found turning off and on the "auto buiild" function may help, or simply restarting Eclipse may sometimes help. It's kind of buggy under Mac OS.
This can happen if .R is imported. Eclipse will automatically add it sometimes when you have difficulty with with R.java