Android - XML Parser works on Android 2.1 - 2.3 but not on Android 4.0 ICS

3ricardo

New Member
I've got a XML Parser which workes on Android 2.1 - 2.3 but not an ICS (Have not tested on 3.0 yet)Can someone explain why? And can someone sugget an solution to that?My XML Parser:\[code\]try { URL url = new URL("my_url"); DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); DocumentBuilder db = dbf.newDocumentBuilder(); Document doc = db.parse(new InputSource(url.openStream())); doc.getDocumentElement().normalize(); NodeList nodeList = doc.getElementsByTagName("item"); /** Assign textview array lenght by arraylist size */ for (int i = 0; i < nodeList.getLength(); i++) { Node node = nodeList.item(i); Element fstElmnt = (Element) node; NodeList nameList = fstElmnt.getElementsByTagName("team1"); Element nameElement = (Element) nameList.item(0); nameList = nameElement.getChildNodes(); team1.setText(nameList.item(i).getNodeValue().toString()); NodeList websiteList = fstElmnt.getElementsByTagName("team2"); Element websiteElement = (Element) websiteList.item(0); websiteList = websiteElement.getChildNodes(); team2.setText(websiteList.item(i).getNodeValue().toString());\[/code\]...etc.(I've got many Nodes in my item)XML:\[code\]<maintag><item> <team1>UKR</team1> <team2>FRA</team2>\[/code\]....\[code\]</item></maintag>\[/code\]EDIT:Extra information:On my Emulator with Android 2.3.3 it shows the parsed text. On my phone with Android 4.0.3 the TextView is plain and also its plain on a Friends phone with ICS
 
Back
Top