I'm sure there's a perfect fine way to do this much better, but basically what I want is to create 2-dim array via strings.xml.
ie. I have a main category:
<string-array name="main_categories">
<item>index_etf</item>
<item>region_etf</item>
<item>commodity_etf</item>
</string-array>
and a bunch of subcategories:
<string-array name="index_etf">
<item>DOW</item>
<item>NASDAQ</item>
</string-array>
instead of doing it hardcoded like:
MainCategoryArray = getResources().getStringArray(R.array.main_categories);
IndexETFArray = getResources().getStringArray(R.array.index_etf);
...
I'd like to do something like:
MainCategoryArray = getResources().getStringArray(R.array.main_categories);
loop through the main array and populate the sub categories
Not sure if I can access the getStringArray with an int variable based on the content of the MainCategoryArray, is there?
Any better approach to build a multi-dimensional based on strings.xml? Sorry, new to this.