I need to access resources in xml dynamically.
res=getResources();
plc=res.obtainTypedArray(R.array.id1);
I would like to do it in a loop => change id1 to id2, id3, … ,id1000 and in that loop work with the items of that respective array. I can do it with single array but can’t jump to another one. Any suggestion how I can do that? ObtainTypedArray expects integer only as a parameter.
Thank you!
Here is the exact solution to my problem of calling the TypedArray from XML in code:
1) in XML create array that indexes data arrays
2) recall the array in the code
Thanks for all your useful advice, Idecided not to use the Field approach but I am sure I will get there after I gain more experience! You can make this solution even better using 2D array but I have no use for it in my code…