我将android 2.2的运行代码转换为android 4.0,但现在我得到了一个expatparser parseexception。
try {
String xmls = LoginActivity.xml;
SAXParserFactory saxPF = SAXParserFactory.newInstance();
SAXParser saxP = saxPF.newSAXParser();
XMLReader xmlR = saxP.getXMLReader();
XMLHandler myXMLHandler = new XMLHandler();
xmlR.setContentHandler(myXMLHandler);
InputStreamReader isr = new InputStreamReader(
new ByteArrayInputStream(xmls.getBytes("UTF-8")));
xmlR.parse(new InputSource(isr));
} catch (Exception e) {
System.out.println(e);
}