Okay, I want to use one layout and change my strings programatically using the strings.xml.
I have 40 questions and always 4 answers (they are static).
so my idea would be something like:
while i < 40:
set question to question[i]
on answer click: i++
How can I fetch the strings dynamically. I always used getResources().getText(R.string.example).
Can I just do something like:
String dynamic = "R.string.example" + i;
getResources().getText(dynamic)
Maybe you could save the answers and the questions in an array in strings.xml (or somewhere else), or maybe some more arrays if you want that. So you can then load the array like you do now with getResources(), but with getStringArray
And if you have an array, you can just dynamically get the right answer/question or whatever you want to do with it.
In strings.xml (or another xml):
In your code:
Is this what you wanted ?