Hi guys~:)
I would like to parse the strings.xml
Here is my code:
Line1: DocumentBuilderFactory factory =
DocumentBuilderFactory.newInstance();
Line2: DocumentBuilder builder = factory.newDocumentBuilder();
Line3: Document dom = builder.parse(new File("//myproject//res//
values//strings.xml"));
Line4: Element root = dom.getDocumentElement();
Line5: NodeList items = root.getElementsByTagName("String");
However, in line3, I don't know what the actual path of the
strings.xml is, could any one can tell me?
Besides, I found another method to work with XML, but I don't know
what the id should be...
XmlPullParser parser = getResources().getXml(id);
--
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