I want to add a string to a variable name that represents an integer. For example:
String test = "v1f1";
set_view(R.drawable.test);
And then ideally it would look for R.drawable.v1f1, but it looks for R.drawable.test instead, which doesn’t exist.
Anyone know how to do this?
Thanks.
You could do this with an enum, as long as you limit yourself to values existing in the enum:
e.g.
You could even do it with integers it you were willing to be really evil-