Hello! The essence of what
there is the following code in string.xml
<string-array name="stroka_1"> <item>Текст1</item> <item>Текст2</item> <item>Текст3</item> </string-array> <string-array name="stroka_2"> <item>Текст11</item> <item>Текст22</item> <item>Текст33</item> </string-array>
In Aktiviti I receive string resources
String[] Stroki= getResources().getStringArray(R.array.stroka_2);
Is there such a possibility in java, in the end instead of 2 put the variable
Example:
String str = "1"; String[] Stroki= getResources().getStringArray(R.array.stroka_+str);
The code naturally shows an error, but I think the idea is clear.
That would not manually register all the thongs
R.array.stroka_1 R.array.stroka_2 R.array.stroka_3 R.array.stroka_4
And just take the variable instead of these numbers