views:

26

answers:

1

Any ideas why at times Eclipse frizzles and doesn't recognize code it did seconds ago? The "R" in the code below has the red squiggle under it when it didn't 5 minutes ago and I've change no code. This happens frequently with Eclipse and usually I shut it down and start it again and it's good to go...no go this time.

// Initialize view elements
    mSearchBox      = (EditText) this.findViewById(R.id.edittext_search);
    mSearchButton   = (Button) this.findViewById(R.id.button_search);
A: 

it sounds like the R class needs to be regenerated, try making a change to the layout file and saving it so the project rebuilds.

Ryan Conrad
Thanks, but that didn't work...any other ideas.
taraloca
check that none of your xml files have errors in them, if one of them does, it could be causing the generation of R to fail. you should be able to see any errors in the android console, plus check the "problems" window.
Ryan Conrad
Thanks...I did have an error in one of my xml files. Corrected it and the problem is now fixed.
taraloca