assign button id by retrieving value from string

kandip

New Member
i am a newbie here. My question is as below:This is my value/strings.xml file:\[code\]<string name="bm">Mengawal</string><string name="bi">Managing</string> <string name="penan">Penan</string><string-array name="menu"> <item>@string/bm</item> <item>@string/bi</item> <item>@string/penan</item> </string-array>\[/code\]I have my dynamically assign button in my java file. Now, i want to set the button id programmatically from the xml above.For example,the button text is ="Mengawal"I wana set the button id to become ="bm"I saw an example over here, but i cant understand what it actually means. Or is it possible for me to make it like this?Is it possible to access a string-array item in Android?Thanks for the help.
 
Back
Top