• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Can't read from XML

orelzion

Lurker
Oct 9, 2010
1
0
It just keep giving me "Permission denied" error.
Here's my code.

Code:
   private RSSFeed getFeed(String urlToRssFeed)
    {
        URL url=null;
        try
        {
            // setup the url
            url = new URL(urlToRssFeed);

           // create the factory
           SAXParserFactory factory = SAXParserFactory.newInstance();
           
           // create a parser
           SAXParser parser = factory.newSAXParser();

           // create the reader (scanner)
           XMLReader xmlreader = parser.getXMLReader();

           // instantiate our handler
           RSSHandler theRssHandler = new RSSHandler();
           
           // assign our handler
           xmlreader.setContentHandler(theRssHandler);

           // get our data through the url class
           xmlreader.parse(new InputSource(url.openStream()));         
           
           // get the results - should be a fully populated RSSFeed instance, 
           // or null on error
           return theRssHandler.getFeed();
        }
        catch (Exception ee)
        {
            // if you have a problem, simply return null
              new AlertDialog.Builder(this)
            .setMessage(ee.getMessage()).show();
            
            return null;
        }
    }
 

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones