You can do something like:

    XmlResourceParser xpp=Resources.getSystem().getXml
(R.color.mycolor);
    ColorStateList csl = ColorStateList.createFromXml(getResources(),
xpp);

where R.color.mycolor is your XML resource file.

--
Jack Ha
Open Source Development Center
・T・ ・ ・Mobile・ stick together
The coverage you need at the price you want

The views, opinions and statements in this email are those of
the author solely in their individual capacity, and do not
necessarily represent those of T-Mobile USA, Inc.


On Sep 12, 4:21 am, manigault <[email protected]> wrote:
> I want to create color state list from xml file containing a selector.
> From the documentation its seems that i have to use static
> ColorStateList createFromXml(Resources r, XmlPullParser parser) but i
> can't figure out what parameters to pass. I guess i can use :
> XmlPullParserFactory factory = XmlPullParserFactory.newInstance();
> XmlPullParser parser = factory.newPullParser();
> to obtain the parser but what about the xml file that i want to parse.
> Thanks
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Beginners" 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-beginners?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to