• support@answerspoint.com

android.os.NetworkOnMainThreadException

Packers and Movers in Patna
1365

In the below code I got an error when running my Android project for RssReader.

URL url = new URL(urlToRssFeed);
SAXParserFactory factory = SAXParserFactory.newInstance();
SAXParser parser = factory.newSAXParser();
XMLReader xmlreader = parser.getXMLReader();
RssHandler theRSSHandler = new RssHandler();
xmlreader.setContentHandler(theRSSHandler);
InputSource is = new InputSource(url.openStream());
xmlreader.parse(is);
return theRSSHandler.getFeed();

And it shows an error:

android.os.NetworkOnMainThreadException

How can I fix this issue?

0Answer


Packers and Movers in Patna

Your Answer

    Facebook Share        
       
  • asked 7 years ago
  • viewed 1365 times
  • active 7 years ago

Best Rated Questions