You referended twice times..

flag.png.
 
 
Franklin Masao Hirata
6365-3650 / 4787-5360
GoogleAndroid's developers 2010
"All programmers are playwrights and all computers are lousy actors."




________________________________
From: Kostya Vasilyev <[email protected]>
To: [email protected]
Sent: Wed, August 25, 2010 5:42:51 AM
Subject: Re: [android-developers] Some confusion on resource IDs

25.08.2010 12:38, Lidia G пишет: 
I want to create somehow "R.drawable.flag" by appending the country extension 
"de" . 

>
>String countryFlag="flag_"+mySource.countryExtension ;     //something like 
>flag_DE
>countryFlag=countryFlag.toLowerCase();                              // =flag_de
>flag.setBackgroundResource(R.drawable.countryFlag);       // of course, it's 
>not 
>working
Some ways to do it:

1 - Set up some kind of data structure with string country names and numeric 
resource ids. Use it for looking up resource ids by county name.

2 - Use Java reflection to get values from the R class.

-- Kostya

--  Kostya Vasilev -- WiFi Manager + pretty widget -- 
http://kmansoft.wordpress.com -- 

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


      

-- 
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

Reply via email to