public static String[] readThisStringArrayXml(XmlPullParser parser, String endTag,
                                                  String[] name) throws XmlPullParserException, IOException {

        int num;
        try {
            num = Integer.parseInt(parser.getAttributeValue(null, "num"));
        } catch (NullPointerException e) {
            throw new XmlPullParserException("Need num attribute in string-array");
        } catch (NumberFormatException e) {
            throw new XmlPullParserException("Not a number in num attribute in string-array");
        }
        parser.next();

        String[] array = new String[num];
        int i = 0;

        int eventType = parser.getEventType();
        do {
            if (eventType == XmlPullParser.START_TAG) {
                if ("item".equals(parser.getName())) {
                    try {
                        array[i] = parser.getAttributeValue(null, "value");
                    } catch (NullPointerException e) {
                        throw new XmlPullParserException("Need value attribute in item");
                    } catch (NumberFormatException e) {
                        throw new XmlPullParserException("Not a number in value attribute in item");
                    }
                } else {
                    throw new XmlPullParserException("Expected item tag at: " + parser.getName());
                }
            } else if (eventType == XmlPullParser.END_TAG) {
                if (parser.getName().equals(endTag)) {
                    return array;
                } else if ("item".equals(parser.getName())) {
                    i++;
                } else {
                    throw new XmlPullParserException("Expected " + endTag + " end tag at: " +
                            parser.getName());
                }
            }
            eventType = parser.next();
        } while (eventType != XmlPullParser.END_DOCUMENT);

        throw new XmlPullParserException("Document ended before " + endTag + " end tag");
    }
Read a String[] object global an XmlPullParser.  The XML data could
previously have been generated by writeStringArrayXml().  The XmlPullParser
must be positioned <em>after</em> the tag that begins the list.

@param parser The XmlPullParser global which to read the list data.
@param endTag Name of the tag that will end the list, usually "string-array".
@param name   An array of one string, used to return the name attribute
              of the list's tag.
@return Returns a newly generated String[].
@see #readListXml
android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/util/XmlUtils.java