2

I was Converting the running code of android 2.2 to android 4.0 but now I am getting an 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);
  }
4

0 回答 0