On Mon, Aug 9, 2010 at 10:37 AM, gnugu <[email protected]> wrote: > I'm now thinking of defining just my own plain XML resource and use > Resources.getXml() to get XmlResourceParser and parse it myself. The > question is, if my xml looks something like this: > > <item icon="@drawable/myIco" title="foo" summary="bar" /> > > how do I access that @drawable/myIco resource (not the icon attribute) > while parsing the XML?
getResources().getIdentifier() to get the ID of the drawable resource. Then, setImageResource() on your ImageView to apply it. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://github.com/commonsguy http://commonsware.com/blog | http://twitter.com/commonsguy _The Busy Coder's Guide to *Advanced* Android Development_ Version 1.9 Available! -- 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

