Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7527661
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T04:09:40+00:00 2026-05-30T04:09:40+00:00

Hi I am trying to use a RSS reader on honeycomb but when a

  • 0

Hi I am trying to use a RSS reader on honeycomb but when a run the following sample of code and run it(i hit a button to start it and it crashes). This is the code where the crash occurs(through debugging):

public List<Article> getLatestArticles(String feedUrl) {
    Log.v("getLatestArticles","entering"+ feedUrl);
    URL url = null;
    try {


        SAXParserFactory spf = SAXParserFactory.newInstance();
        Log.v("getLatestArticles","made instance");
        SAXParser sp = spf.newSAXParser();
        XMLReader xr = sp.getXMLReader();
        Log.v("getLatestArticles","made a bunch of stuff");

        url = new URL(feedUrl);
        Log.v("getLatestArticles","made URL");
        xr.setContentHandler(this);
        Log.v("getLatestArticles","RSS is the following" + this.toString());
        Log.v("getLatestArticles","RSS is the following");
        xr.parse(new InputSource(url.openStream()));
        Log.v("getLatestArticles","made parsing possible");

The crash occurs at xr.parse(new InputSource(url.openStream())); I also found that the crash is occuring only because of url.openStream(). If I try to even run this I get an error.

And here below is the debug information I receive:

02-20 17:17:56.566: D/AndroidRuntime(449): Shutting down VM
02-20 17:17:56.566: W/dalvikvm(449): threadid=1: thread exiting with uncaught exception (group=0x40014760)
02-20 17:17:56.586: E/AndroidRuntime(449): FATAL EXCEPTION: main
02-20 17:17:56.586: E/AndroidRuntime(449): android.os.NetworkOnMainThreadException
02-20 17:17:56.586: E/AndroidRuntime(449):  at android.os.StrictMode$AndroidBlockGuardPolicy.onNetwork(StrictMode.java:1077)
02-20 17:17:56.586: E/AndroidRuntime(449):  at java.net.InetAddress.lookupHostByName(InetAddress.java:481)
02-20 17:17:56.586: E/AndroidRuntime(449):  at java.net.InetAddress.getAllByNameImpl(InetAddress.java:281)
02-20 17:17:56.586: E/AndroidRuntime(449):  at java.net.InetAddress.getAllByName(InetAddress.java:249)
02-20 17:17:56.586: E/AndroidRuntime(449):  at org.apache.harmony.luni.internal.net.www.protocol.http.HttpConnection.<init>(HttpConnection.java:69)
02-20 17:17:56.586: E/AndroidRuntime(449):  at org.apache.harmony.luni.internal.net.www.protocol.http.HttpConnection.<init>(HttpConnection.java:48)
02-20 17:17:56.586: E/AndroidRuntime(449):  at org.apache.harmony.luni.internal.net.www.protocol.http.HttpConnection$Address.connect(HttpConnection.java:304)
02-20 17:17:56.586: E/AndroidRuntime(449):  at org.apache.harmony.luni.internal.net.www.protocol.http.HttpConnectionPool.get(HttpConnectionPool.java:89)
02-20 17:17:56.586: E/AndroidRuntime(449):  at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.getHttpConnection(HttpURLConnectionImpl.java:292)
02-20 17:17:56.586: E/AndroidRuntime(449):  at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.makeConnection(HttpURLConnectionImpl.java:274)
02-20 17:17:56.586: E/AndroidRuntime(449):  at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.retrieveResponse(HttpURLConnectionImpl.java:1038)
02-20 17:17:56.586: E/AndroidRuntime(449):  at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.getInputStream(HttpURLConnectionImpl.java:523)
02-20 17:17:56.586: E/AndroidRuntime(449):  at java.net.URL.openStream(URL.java:645)
02-20 17:17:56.586: E/AndroidRuntime(449):  at com.tmm.android.rssreader.util.RSSHandler.getLatestArticles(RSSHandler.java:166)
02-20 17:17:56.586: E/AndroidRuntime(449):  at com.tmm.android.rssreader.reader.RssReader.getLatestRssFeed(RssReader.java:44)
02-20 17:17:56.586: E/AndroidRuntime(449):  at com.tmm.android.rssreader.reader.NewspaperFragment.onCreateView(NewspaperFragment.java:38)
02-20 17:17:56.586: E/AndroidRuntime(449):  at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:730)
02-20 17:17:56.586: E/AndroidRuntime(449):  at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:921)
02-20 17:17:56.586: E/AndroidRuntime(449):  at android.app.BackStackRecord.run(BackStackRecord.java:578)
02-20 17:17:56.586: E/AndroidRuntime(449):  at android.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1221)
02-20 17:17:56.586: E/AndroidRuntime(449):  at android.app.FragmentManagerImpl$1.run(FragmentManager.java:375)
02-20 17:17:56.586: E/AndroidRuntime(449):  at android.os.Handler.handleCallback(Handler.java:587)
02-20 17:17:56.586: E/AndroidRuntime(449):  at android.os.Handler.dispatchMessage(Handler.java:92)
02-20 17:17:56.586: E/AndroidRuntime(449):  at android.os.Looper.loop(Looper.java:126)
02-20 17:17:56.586: E/AndroidRuntime(449):  at android.app.ActivityThread.main(ActivityThread.java:3997)
02-20 17:17:56.586: E/AndroidRuntime(449):  at java.lang.reflect.Method.invokeNative(Native Method)
02-20 17:17:56.586: E/AndroidRuntime(449):  at java.lang.reflect.Method.invoke(Method.java:491)
02-20 17:17:56.586: E/AndroidRuntime(449):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:841)
02-20 17:17:56.586: E/AndroidRuntime(449):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:599)
02-20 17:17:56.586: E/AndroidRuntime(449):  at dalvik.system.NativeStart.main(Native Method)

Has anyone run into this problem or encountered something similar? Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T04:09:42+00:00Added an answer on May 30, 2026 at 4:09 am

    Your device not allowing to establish httpconnection. Due to which it is not getting any data. It is not SAX parser failing. I strongly suspect it is because you are trying to access HTTP calls on UI thread. Here is interesting blog on this topic.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to to use this class http://robbyonrails.com/articles/2005/05/11/parsing-a-rss-feed but am not sure where to
I'm trying to use marquee plugin of jQuery. but i get this error in
I'm trying to develop an Android RSS Reader. I would like to use android.sax
I'm trying to use SimpleXML to read our News RSS feed but it's not
I'm trying to add support for stackoverflow feeds in my rss reader but SelectNodes
I'm trying to use an RSS feed from my blog on the news section
I am trying to retrieve and use the raw data from RSS feeds. For
I was trying use a set of filter functions to run the appropriate routine,
I'm trying use mod_rewrite to rewrite URLs from the following: http://www.site.com/one-two-file.php to http://www.site.com/one/two/file.php The
Trying to use a guid as a resource id in a rest url but

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.