I have a file "numeric.xml" in my "values" directory, which contains most of the project integer constants. I would like to use some of these constants in the switch statement, but Eclipse / Java does not like this because it does not consider "resources.getInteger (R.integer.INTEGER_NAME)" as constant. Is there a way to make the compiler and / or Eclipse see that it is a constant, or do I just need to live with if / else goals?
Edit: I tried to execute "final int INTEGER_NAME = resources.getInteger (R.integer.INTEGER_NAME)" and using INTEGER_NAME in the case argument, but that didn't work either.
source
share