In my app I use an array of drawable ids. It's an XML file saved at res/values/arrays.xml:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<array name="icons">
<item>@drawable/home</item>
<item>@drawable/settings</item>
<item>@drawable/logout</item>
</array>
</resources>
Then I retrive it using this code:
Resources res = getResources();
TypedArray icons = res.obtainTypedArray(R.array.icons);
Drawable drawable = icons.getDrawable(0);
But I get an error saying: array "cannot be resolved or is not a field".
So How do I get an array of ints that contains the ids from the xml file?
Thanks :)