Skip to content

Instantly share code, notes, and snippets.

@robhinds
Created March 19, 2013 21:07
Show Gist options
  • Save robhinds/5200144 to your computer and use it in GitHub Desktop.
Save robhinds/5200144 to your computer and use it in GitHub Desktop.
@Override
protected List<Article> doInBackground(String... urls) {
String feed = urls[0];
URL url = null;
try {
SAXParserFactory spf = SAXParserFactory.newInstance();
SAXParser sp = spf.newSAXParser();
XMLReader xr = sp.getXMLReader();
url = new URL(feed);
RssHandler rh = new RssHandler();
xr.setContentHandler(rh);
xr.parse(new InputSource(url.openStream()));
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment