R cannot be resolved to a variable

1) see if the xml files in the Package Explorer tree have an error-icon
if they do, fix errors and R-class will be generated.

example hint: FILL_PARENT was renamed MATCH_PARENT in API Level 8; so if you’re targeting platform 2.1 (api 7), change all occurences back to “fill_parent”

2) if you added “import android.R;” trying to do a quick-fix, remove that line

Leave a Comment