Once in a while I want to populate a list with items that are static, what/where is the best way to store those static items?
I normally use an xml resource with something like this:
<string-array name="category_ids">
<item>0</item>
<item>1</item>
<item>2</item>
</string-array>
<array name="category_titles">
<item>@string/category_all</item>
<item>@string/category_new</item>
<item>@string/category_hot</item>
</array>
<array name="category_icon_ids">
<item>@null</item>
<item>@drawable/ic_category_star</item>
<item>@drawable/ic_category_thumb</item>
</array>
I access these arrays and populate an adapter with custom objects. But it annoys me every time I use it. When I change the order in the list for example, I have to change every array in the xml.
Is there a better solution? Are custom XML objects supported?