I'm currently doing Android development.
The class R (an automatically-generated class) has lots of 'global' values accessed from anywhere like so:
R.drawable.<file_name_ignoring_suffix>
I have lots of files named 'item_0.png', 'item_1.png', 'item_2.png' etc.
Is there an easy way to iterate through these items without putting them into an array first?
My current implementation:
int[] itemResources = { R.drawable.item_0, R.drawable.item_1, R.drawable.item_2,
R.drawable.item_3, R.drawable.item_4, R.drawable.item_5 };
... then iterating through the array.
This works well, but it isn't particularly maintainable, and gets laborious when I have many items.
Any ideas?