0

I have my code currently like this:

riddle_no += 1;

String riddleString = "riddle_" + riddle_no;

String riddle = getResources().getString(R.string.riddleString);

I want to replace 'riddleString' in getString() with the string variable. So far I have no idea how to do that.

Hucen Farhan
  • 243
  • 1
  • 3
  • 10
  • What are you trying to do? – Sagar Hatekar Oct 21 '15 at 20:26
  • @SagarHatekar I have riddles in an xml file under values. I want to get, for example, riddle_1 according to the variable riddleString. If I manually insert riddle_1 it works. But I want it to change as I change the variable. – Hucen Farhan Oct 21 '15 at 20:31

0 Answers0