[Solved] get all resource IDs in res/drawable in int array

Put your problem here if it does not fit any of the other categories.

[Solved] get all resource IDs in res/drawable in int array

Postby moonraker928 » Thu Jan 17, 2008 12:11 am

hey.

i have X drawable images in res/drawable. hence there are X different ids. i want to get all the X ids and store them in an int array without getting an id for EACH image manually...

basically, my app should get the ids of all the images stored in that folder every time it starts, without me having to manually add lines of code to get the id of each newly added image in that folder using getResources.

i've looked at the other functions in the api - havent been able to find one that does this...

hope you can help. thanks.
moonraker928
Freshman
Freshman
 
Posts: 9
Joined: Wed Jan 16, 2008 11:34 pm

Top

Postby plusminus » Thu Jan 17, 2008 7:38 pm

Hello moonraker,

I transformed the answer to your post into a Tutorial:
:arrow: :src: Go there ....

Hope I could help you.

Regards,
plusminus
Image
Image | Android Development Community / Tutorials
User avatar
plusminus
Site Admin
Site Admin
 
Posts: 2688
Joined: Wed Nov 14, 2007 8:37 pm
Location: Schriesheim, Germany

Postby moonraker928 » Thu Jan 17, 2008 10:49 pm

Awesome...thanks a lot!

I was playing around with java reflection too but you just made my task a lot easier!

thanks.
moonraker928
Freshman
Freshman
 
Posts: 9
Joined: Wed Jan 16, 2008 11:34 pm

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: No registered users and 22 guests