Previously I had a simple string-array that contained a URL it looked like
- http://www.goo
This is what I've done to accomplish something like this:
- @array/menu_item_dashboard
- @array/menu_item_index
- @drawable/transparent
- Dashboard
- home
- @drawable/transparent
- Title
- index
And to access:
TypedArray menuResources = getResources().obtainTypedArray(R.array.menu_items);
TypedArray itemDef;
for (int i = 0; i < menuResources.length(); i++) {
int resId = menuResources.getResourceId(i, -1);
if (resId < 0) {
continue;
}
itemDef = getResources().obtainTypedArray(resId);
//itemDef.getDrawable(0)
//itemDef.getString(1)
//itemDef.getString(2)
}