I have the following XML structure stored in my assets / xml folder:
<?xml version="1.0" encoding="utf-8"?> <homescreen> <homeitem name="Name1" subtext="Description1" icon="iconresource1" /> <homeitem name="Name2" subtext="Description2" icon="iconresource2" /> <homeitem name="Name3" subtext="Description3" icon="iconresource3" /> </homescreen>
I read every homeitem using XmlPullParser:
int event; String TAG_ITEM = "homeitem"; while ((event = parser.next()) != XmlPullParser.END_DOCUMENT) { if (event == XmlPullParser.START_TAG) { String tag = parser.getName(); if (TAG_ITEM.equals(tag)) {
My problem: using getAttributeValue(String, String) always returns null . Using getAttributeValue(Integer) works great. What am I doing wrong?
Device: Nexus 10, Stock KitKat 4.4
source share