Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- XmlResourceParser parser = context.getResources().getXml(resource);
- int eventType = parser.getEventType();
- while (eventType != XmlPullParser.END_DOCUMENT) {
- if (eventType == XmlPullParser.START_TAG) {
- if (parser.getName().equals("array")) {
- for (int i = 0; i < parser.getAttributeCount(); i++) {
- if (parser.getAttributeName(i).equals("id")) {
- if (parser.getAttributeValue(i).equals("blah")) {
- Log.d(TAG,"the value of array is blah");
- }
- }
- }
- }
- }
- eventType = parser.next();
- }
Advertisement
Add Comment
Please, Sign In to add comment