Hello,
I have a problem which is the following : I can't load a resources from a variable (which would contain the id or the name of the resource):
For instance if you do :
(With an XML containing a button with id "buttonNb12" of course
)
It will work.
But if you have your Id in a String how can you do it ? The following method doesn't work
:
or this ...
Do you have a solution please ?
Thanks
I have a problem which is the following : I can't load a resources from a variable (which would contain the id or the name of the resource):
For instance if you do :
Code:
Button button = (button)findViewById (R.id.buttonNb12)

It will work.
But if you have your Id in a String how can you do it ? The following method doesn't work

Code:
String x = "buttonNb12"
Button button = (button)findViewById (R.id.(x))
Code:
String x = "R.id.buttonNb12"
Button button = (button)findViewById(x))
Thanks