Find a resource by file name?

Put problem concerning Views, Layouts and other XML-Resources (like AndroidManifest) here.

Find a resource by file name?

Postby scuba » Sun Feb 07, 2010 5:06 pm

Hi,

I have many images that are all named with a unique identifier that lines up with a dataset. So 12.png, 189.png, ect...

How can I set an Image src to one of these files? I only know the file name, not the ID.

Thanks!
scuba
Junior Developer
Junior Developer
 
Posts: 19
Joined: Wed Nov 11, 2009 4:19 am

Top

Re: Find a resource by file name?

Postby pskink » Sun Feb 07, 2010 8:11 pm

scuba wrote:Hi,

I have many images that are all named with a unique identifier that lines up with a dataset. So 12.png, 189.png, ect...

How can I set an Image src to one of these files? I only know the file name, not the ID.

Thanks!


you can get resources only by ID

so you need ID, see:
http://www.anddev.org/rdrawable-t10867.html
pskink
pskink
Master Developer
Master Developer
 
Posts: 719
Joined: Mon Nov 24, 2008 3:49 pm

Postby qlimax » Sun Feb 07, 2010 10:51 pm

¯`·.¸¸.><((((º>¯`·.¸¸. ><((((º>
User avatar
qlimax
Master Developer
Master Developer
 
Posts: 271
Joined: Mon Aug 31, 2009 10:54 am
Location: Swiss

Top

Return to View, Layout & Resource Problems

Who is online

Users browsing this forum: Exabot [Bot] and 8 guests