-2

How to fix this???

I can't delete that id. What should I do?

2 Answers2

0

R file is (or should be) re-generated automatically on every build. You should try some dependency-injection framework (Roboguice works well for Android programming) to clean up issues with handling Views

Can/should I edit the R.java file. If so, how?

islamdidarmd
  • 725
  • 5
  • 19
0

Its not a good idea to edit R.java as its a generated class and will get overwritten once you try to build again anyway. The variable you're trying to delete was obviously generated from one of your resources so you should look for the ID field in one of your layouts, drawables, etc, and just change its name to something other than "1". Just do a solution search (Cmd + Shift + O on a mac - likely Ctrl + Shift + O on win) for "@+id/1" and see if something comes up.

If you've already done this I sadly have no idea how that would have gotten there as Java doesn't allow numbers for variable names - and thats why its complaining in the first place.

alexpwalsh
  • 39
  • 10