Here you can find the source of getXmlAttribute(Context context, XmlResourceParser xml, String name)
private static String getXmlAttribute(Context context, XmlResourceParser xml, String name)
//package com.java2s; import android.content.Context; import android.content.res.XmlResourceParser; public class Main { private static String getXmlAttribute(Context context, XmlResourceParser xml, String name) { int resId = xml.getAttributeResourceValue(null, name, 0); if (resId == 0) { return xml.getAttributeValue(null, name); } else {// w w w . j a va 2 s . c om return context.getString(resId); } } }