When importing the apidemos of the android sample, you find that the R. Id. XX file cannot be used in switch cases for Google query. Find the following answer:
As of ADT 14, resource fields cannot be used as switch cases.In other words, the constants are not final in a library project. the reason for this is simple: when multiple library projects are combined, the actual values of the fields (which must be unique) cocould collide. before ADT 14, all fields were final, so as a result, all libraries had to have all their resources and associated Java code recompiled along with the main project whenever they were used. this was bad for performance, since it made builds very slow. it also prevented distributing library projects that didn't include the source code, limiting the usage scope of library projects.
The solution is to change switch cases to If else, which can be used in eclipse.
CTRL + 1Shortcut switch.
As of ADT 14, resource fields cannot be used as switch Cases