Hi Leif,
In this case, I think it's not a good idea to use two integers just to control a resource (sorry for my English skill, it may cause you misunderstand)
I mean, each resource has its own integer id in the class R in the gen folder, and now you create another integer to display the id, it's no need to do that.
I have some trick to handle what you want:
Rename the resources you want in order, and in R class, they will be in order and increase by 1, then you can use that.
Here is an example:
I have 5 resources in raw folder, they are: sound01, sound02, sound03, sound04, sound05
And in the R file, I get:
public static final class raw {
public static final int sound01=0x7f040000;
public static final int sound02=0x7f040001;
public static final int sound03=0x7f040002;
public static final int sound04=0x7f040003;
public static final int sound05=0x7f040004;
}
It's an array of integers, right?
And for the for loop, example:
for(int i = R.raw.sound01; i<= R.raw.sound02; i++) {
//do somethings
}
Since my English skill is not good, hope you can get my point!