Java Code Examples for android.content.res.XmlResourceParser#require()
The following examples show how to use
android.content.res.XmlResourceParser#require() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: WhatsNewDialog.java From trekarta with GNU General Public License v3.0 | 6 votes |
private void readRelease(XmlResourceParser parser) throws XmlPullParserException, IOException { parser.require(XmlPullParser.START_TAG, null, TAG_RELEASE); while (parser.next() != XmlPullParser.END_TAG) { if (parser.getEventType() != XmlPullParser.START_TAG) { continue; } String name = parser.getName(); if (name.equals(TAG_CHANGE)) { parser.require(XmlPullParser.START_TAG, null, TAG_CHANGE); String variant = parser.getAttributeValue(null, ATTRIBUTE_VARIANT); ChangeListItem changeItem = new ChangeListItem(); changeItem.change = readText(parser); if (BuildConfig.FULL_VERSION || !"full".equals(variant)) mChangelog.add(changeItem); parser.require(XmlPullParser.END_TAG, null, TAG_CHANGE); } else { skip(parser); } } parser.require(XmlPullParser.END_TAG, null, TAG_RELEASE); }