Code example for XmlResourceParser

Methods: getAttributeResourceValue, getAttributeValue

0
     *          Index of resolving string in the parser. 
     * @return Resolved string. 
     */ 
    protected final String resolveString(XmlResourceParser parser, int currentIndex) {
        String string;
        final int stringRes = parser.getAttributeResourceValue(currentIndex, -1);
        switch (stringRes) {
            case -1: 
                string = parser.getAttributeValue(currentIndex);
                break; 
            case 0: 
                string = null;
                break; 
            default: 
                string = getResources().getString(stringRes);
                break; 
        } 
        return string;
    } 
 
	/**