It is necessary to make it so that the program can work with arrays from resources, but that the names of the arrays are not predetermined in advance in the code of the program itself.
I was advised to use HashMap , but I do not fully understand how to use it in my case.
Map <String, String[]> hashmap = new HashMap<>(); int current = 1; In the resources we have an array of the format name (will be the same for all arrays) and number (will change).
String wpqp = Integer.toString(current); hashmap.put (wpqp, "getResouces().getStringArray(R.array.somearray)" + Integer.toString(current)); I get the error that the String cannot be converted to String[] . Most likely, the solution is very simple, but I still can not find it on my own.