I have an Android app (Written in Android Studio) which I'm trying to streamline. Basically, 10 buttons on the same screen each with a unique id of "button1" through "button10".
My question regards findViewById. I understand that it takes an integer as its argument and I can get it to work using findViewById(R.id.button1) etc but how can I make the R.id.button1 part generic? Eg How could I incorporate the R.id.button1 part into a For loop so that I could change the text on all the buttons programatically? I've tried constructing the argument part via something like "R.id.button" + z + "" (Where z loops from 1 to 10) but then the argument isn't integer. What am I missing?
Many thanks for any help...
Simon