I receive string array names from my intent extras ( KI1,KI2, etc )
Instead of hardcoding the string array name (like R.array.KI1), I want variables replacing them .
strdata = receiverIntent.getExtras().getString("intentExtra");
String[] pointDetails = getResources().getStringArray**(R.array.KI1);**
Resource file
<resources>
<string-array name="KI1">
<item>Categories Text KI1</item>
<item>Unitary Channel Text KI1</item>
<item>Localization Text KI1</item>
<item>Action Text KI1</item>
<item>Indication Text KI1</item>
<item>Point location Text KI1</item>
<item>KI1.png</item>
</string-array>
<string-array name="KI2">
<item>Categories Text KI2</item>
<item>Unitary Channel Text KI2</item>
<item>Localization Text KI2</item>
<item>Action Text KI2</item>
<item>Indication Text KI2</item>
<item>Point location Text KI2</item>
<item>KI2.png</item>
</string-array>
</resources>
Why is it not possible to do something like this :
String[] pointDetails = getResources().getStringArray("R.array." + strdata);
I want the output of a variable to be like : R.array.strdata