Hi -
I'd like to know if its possible, from within a program, to get the id
of each resource in a particular res/ directory?
As an example, let's assume I'm building a method that will change the
background image every 20 seconds. I'd like the method to:
1. get the id's of every image in the res/drawable directory,
2. store the ids of those images in an array and
3. cycle through the array changing the background image every 20
seconds.
In code, it would look something like:
int [] drawableIDs = null;
String [] drawableNames = null;
...
// get a listing of all the resource names in the 'drawable' directory
drawableNames = getFileNamesFromResDirectory("drawable");
// return an array of resource IDs
drawableIDs = getMatchingResourceIDs( drawableNames );
Now, I don't care if it's exactly like the above. I just need to:
1. determine the contents of a res/ directory and
2. gain access to the id of each resource in the directory AND
3. do (1) and (2) in code.
If (1) and (2) are combined in a single method, fine. If they are in
distinct methods, that's also fine.
Thanks in advance,
Dr. Jake
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
To unsubscribe from this group, send email to
android-developers+unsubscribegooglegroups.com or reply to this email with the
words "REMOVE ME" as the subject.