i have some string values which are stored in string.xml. I can access them like R.string.d1, R.string.d2... But I need to refer these resources programmatically like if possible R.string.(some code to achieve d2) . I don't know how to do it. Kindly help me in this issue. I want to automatically achieve the R.string.d1/d2/d3/d4... Part. I have string names like d1,d2,...upto d500 so manually assigning them is too hard.
Asked
Active
Viewed 37 times
0
-
Please, edit your question and add the string.xml structure, how your Java code looks like and what you expect to acomplish – Sebastian D'Agostino Jun 09 '18 at 18:13
-
I will upload the code snippet...i need to refer string resource e.g: textview.setText(R.string.d1); But i don't want to set "d1" manually. If it is possible to assign it like R.string.(some code), the "some code" will produce any value like d1/d2/d3... – deepesh Jun 09 '18 at 18:24