I want to use an intent string extra to dynamically determine what String array in an XML file to use. Java code:
Intent myIntent = getIntent();
String stringID = myIntent.getStringExtra("stringID");//pull string id
String[] allStrings = getResources().getStringArray(stringID);
The XML:
<string-array name="set1">
<item>item1</item>
<item>item2</item>
<item>item3</item>
</string-array>
The last line in the java code doesn't work because it wants something like r.array.set1, but I want to choose this dynamically instead. How can I accomplish this? Would it be easier to use the ID of the string array somehow?