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 5842771
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T12:03:43+00:00 2026-05-22T12:03:43+00:00

i have an rss feed that comes via an XML. There are several events

  • 0

i have an rss feed that comes via an XML. There are several events that are returned with information about them. The events are returned with tags…for eg: ….info…

as soon as i encounter tag, i want to update the listview that i am using to show the events.
So the user does not see the loading progress dialog, rather he sees the events getting added to a list.
How do i do this.

thank you in advance.

  • 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-22T12:03:44+00:00Added an answer on May 22, 2026 at 12:03 pm

    Here’s pseudo codeish example for one way of doing this using SAX parser;

    // MyParserThread is assumed to be inner class of Activity here.
    private class MyParserThread extends Thread implements MyParserObserver {
        private MyParser mParser;
        public MyParserThread() {
           mParser = new MyParser();
           mParser.setObserver(this);
        }
        public void run() {
            try {
                // load xml
                mParser.parse(xml);
            } catch (Exception ex) {
            }
        }
        public void onMyParserEvent(final DataReceivedFromParsing data) {
            runOnUiThread(new Runnable() {
                public void run() {
                     // update data to your UI.
                }
            });
        }
        public void cancel() {
            mParser.cancel();
        }
    }
    

    And in your parser you’re implementing ContentHandler

    public void cancel() {
        mCancelled = true;
    }
    public void startElement(....) {
        if (mCancelled) {
            // If you want to stop Thread from running, all you have to do
            // is make parsing stop.
            throw new SAXException("Cancelled");
        }
        ....
    }
    

    And triggering parsing once your onCreate is called would be;

    public void onCreate(...) {
        ...
        mParserThread = new MyParserThread();
        mParserThread.start();
        ...
    }
    

    Now this isn’t perfect but hopefully gives some idea how to do Thread handling for this purpose. Fundamentally you just have start it, and adding ‘cancel’ functionality is somewhat more of a bonus – e.g. for cases in which Activity is destroyed while your Thread is running.

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

Sidebar

Related Questions

i have this rss feed to parse that contains several tags. i am able
I have a dynamically generated rss feed that is about 150M in size (don't
So I have RSS feed of 10 000 records in file.xml (I collected them
Is there a way to create an RSS feed that only customers who have
I have this script to generate an XML file for an RSS feed. Works
I have user generated podcasts, each with their own RSS feed. Is there a
I have links being generated by an RSS feed that lead to nowhere for
I am displaying some RSS feeds in my site that I have them in
I have a blog's RSS feed that I am trying to display on another
I have an RSS feed that I follow and would like to display it

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.