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

  • Home
  • SEARCH
  • 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 7987107
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T12:03:07+00:00 2026-06-04T12:03:07+00:00

I have a sax parser which runs when the user taps a start button.

  • 0

I have a sax parser which runs when the user taps a start button. I would like to set a progress bar view which will update as the parser progresses.

My code is currently as follows :

public void onCreate (Bundle savedInstanceState) {

    super.onCreate(savedInstanceState);

    setContentView(R.layout.progressview);

    try {
        XMLParser.parse(getAssets().open("deindexed.xml"), this);
    } catch (IOException e) {
        Log.d("XML","onCreate(): parse() failed");
        return;
    }

    //Start the Main Activity.
    System.out.println("Activity recreated");
    Intent i = new Intent(this, Simple.class);
    startActivity(i);

}

The problem is that the setContentView does not update until the parser has completed (which I understand is to be expected).

Can anyone advise me on the best way to transform the above so it runs using a thread ?

Thank you.

  • 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-06-04T12:03:09+00:00Added an answer on June 4, 2026 at 12:03 pm

    Check out ASyncTasks. Or, use real Threading and use a Handler to pass messages back/forth. Using ASyncTasks is usually easier/neater, but sometimes it cannot be as versatile as a Thread. For your XML parser, an ASyncTask should work fine.

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

Sidebar

Related Questions

I have a java SAX parser which I would like to call multiple times
I have been using a SAX parser for a while now to get data
I have a problem with sax parser and encoded text. I try to parse
I have a problem with using the SAX parser to parse a XML file.
I have a socket feeding into a sax parser, formatted as a ISO 8859/1
I have student.xml file and am parsing this file using SAX Parser and now
I have different modules like Author.pm, BillingPeriod.pm, Offer.pm,PaymentMethod.pm etc. now in sax whenever I
i want parse xml file, which does't have xml extension, like this: http://bizonek.wrzuta.pl/xml/plik/1ANdXCgTOit/unknow/undefined/643/ my
I have some XML that I'm parsing with a SAX parser in Java. It
in my app i have two editbox in which the user types the email

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.