Getting 'weird' RSS results in Android

Sofeboobvob

New Member
I'm not sure if this is a good question, but I'm really blocked by this. Need some advice.I'm working on an Android app where a part of the app is to retrieve 2 seperate RSS feeds in 2 different menus.I'm using the same code for both feeds, but both feeds come up 'weird'.Some urls I use come up fine, with titles all lined up well, while other urls I use, like the ones I need (one is from ReverbNation (show schedule) and one is from Facebook (wall feed)), end up getting shown all 'split up'.What happens is that when I put the results in a ListView, and I see the results back, some strings have been split up into seperate strings / listview items and some strings are even blank and show up as blank listview items.Is there any advice someone has for me? I know it's kind of a vague question, but I hit a wall here.Code:\[code\]private class RSSHandler extends DefaultHandler { final int stateUnknown = 0; final int stateTitle = 1; final int stateLink = 2; int state = stateUnknown; @Override public void startDocument() throws SAXException { // TODO Auto-generated method stub } @Override public void endDocument() throws SAXException { // TODO Auto-generated method stub } @Override public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException { localnames.add(localName); if (localName.equalsIgnoreCase("title")) { state = stateTitle; } else if (localName.equalsIgnoreCase("link")){ state = stateLink; } else if (localName.equalsIgnoreCase("item")){ Log.d("Tour", "item"); } else { state = stateUnknown; } } @Override public void endElement(String uri, String localName, String qName) throws SAXException { // TODO Auto-generated method stub state = stateUnknown; } @Override public void characters(char[] ch, int start, int length) throws SAXException { // TODO Auto-generated method stub String strCharacters = new String(ch, start, length); xmlStrings.add(strCharacters); if (state == stateTitle) { item.add(strCharacters); } else if (state == stateLink) { itemLink.add(strCharacters); } }\[/code\]
 
Back
Top