title: How can I fix 'android.os.NetworkOnMainThreadException'?
body: <p>I got an error while running my Android project for RssReader. </p>
  
  <p>Code:</p>
  
  <pre><code>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();
  </code></pre>
  
  <p>And it shows the below error:</p>
  
  <pre><code>android.os.NetworkOnMainThreadException
  </code></pre>
  
  <p>How can I fix this issue?</p>