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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T22:52:55+00:00 2026-05-28T22:52:55+00:00

I am trying to display a progress dialog in java ‘A’. At the moment

  • 0

I am trying to display a progress dialog in java ‘A’. At the moment that am calling from ‘A’ a class from java ‘B’ which the certain java it download data from a webservice and save the data to a file. The progress dialog it does not show. The code I am using is:

ProgressDlg= ProgressDialog.show(Doctor.this, "","Loading. Please wait...", true);
String time_batch=mDataIntent.getExtras().getString("TIME_BATCH");
String patientid=mDataIntent.getExtras().getString("PatientId")
mGetHeartRate = new GetHeartRate(Doctor.this, mHandler);
mgetEcgAnalized = new getEcgAnalized(Doctor.this, mHandler);
mGetHeartRate.getHeart(patientid,time_batch);                                      
mgetEcgAnalized.getECG(patientid, time_batch, "I".toString());
ProgressDlg.dismiss();
  • 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-28T22:52:56+00:00Added an answer on May 28, 2026 at 10:52 pm

    Are you executing the ProgressDialog in a AsyncTask? Something like this:

    public class ExampleTask extends AsyncTask<String, Integer, String> {
        private ProgressDialog progressDlg;
        private Context context;
        private Handler progressHandler;
    
        public ExampleTask(Context context) {
            this.context = context;
        }
    
        @Override
        protected void onPreExecute() {
            progressHandler = new Handler();
        }
    
        @Override
        protected String doInBackground(String... params) {
            //to do
        }
    
        @Override
        protected void onPostExecute(String filePath) {
            if (progressDlg != null) {
                progressDlg.dismiss();
                progressDlg = null;
            }
        }
    
        @Override
        protected void onProgressUpdate(final Integer... values) {
            final int progress = values[0] / 1000;
            if (progressDlg == null) {
                progressHandler.post(new Runnable() {
                    @Override
                    public void run() {
                        final int max = values[1] / 1000;
                        progressDlg = new ProgressDialog(context);
                        progressDlg.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
                        progressDlg.setMessage("Message");
                        progressDlg.setMax(max);
                        progressDlg.show();
    
                    }
                });
            } else {
                progressDlg.setProgress(progress);
            }
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to display a progress dialog during downloading of data. Right now,
I am trying to display the progress of a POST call from my TIdHTTP
I am trying to display a progress dialog when the app runs for the
I am trying to display a dialog in a non-Activity class. Basically, I detect
I'm trying to display an update progress loading image whenever my update panel does
When trying to display a byte stream from HLDS (Half-Life Dedicated Server) in a
I'm trying to display a series of titles varying from 60 characters to 160
I am trying to display a pie chart that shows sales by company. However
I am trying to display the progress bar(marque) in a separate form (progressForm) while
I'm trying to get a Gtk::Spinner object to display while calculations are in progress

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.