Code example for XmlResourceParser

Methods: getAttributeValue

0
	 * 
	 * Ensures that we only read from the Android namespace, and resolves 
	 * resource identifiers if necessary. 
	 */ 
	private String getAttr(String attributeName) {
		String value = mCurrentXML.getAttributeValue(SDK_NS_RESOURCES, attributeName);
		// TODO: It's possible to use getAttributeResourceValue and check for 
		// default value return rather than parsing the @ ourselves. Is it faster? 
		return resolveValue(value, mCurrentResources);
	} 
 
	/** 
	 * Return the value, resolving it through the provided resources if 
	 * it appears to be a resource ID. Otherwise just returns what was 
	 * provided. 
	 */ 
	private String resolveValue(String in, Resources r) {
		if (in == null || !in.startsWith("@") || r == null)
			return in;
		try { 
			int num = Integer.parseInt(in.substring(1));