I would like to fix this error
R cannot be resolved to a variable
I looked up many answers, but I could not get the right one;
This error is because of deleting R.java
file from project /gen
folder. If you have backup of your project, please go to the project directory and paste R.java
file which you copy from your backup section.
Corrupt R.java file can also be caused by an error in XML. Often these kinds of errors don't show up in eclipse, so I'd suggest taking a look at your XML files. After that you can also try to Clean
your project by going to Project -> Clean...
in the menu bar.