correction on getNamespace parser

This commit is contained in:
REAndroid 2023-04-16 21:38:34 +02:00
parent fe0ec339ff
commit 9d0a62444c

View File

@ -379,17 +379,17 @@ public class ResXmlPullParser implements XmlResourceParser {
} }
@Override @Override
public String getNamespacePrefix(int pos) throws XmlPullParserException { public String getNamespacePrefix(int pos) throws XmlPullParserException {
ResXmlAttribute attribute = getResXmlAttributeAt(pos); ResXmlElement element = getCurrentElement();
if(attribute!=null){ if(element!=null){
return attribute.getNamePrefix(); return element.getStartNamespaceList().get(pos).getPrefix();
} }
return null; return null;
} }
@Override @Override
public String getNamespaceUri(int pos) throws XmlPullParserException { public String getNamespaceUri(int pos) throws XmlPullParserException {
ResXmlAttribute attribute = getResXmlAttributeAt(pos); ResXmlElement element = getCurrentElement();
if(attribute!=null){ if(element!=null){
return attribute.getUri(); return element.getStartNamespaceList().get(pos).getUri();
} }
return null; return null;
} }