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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T05:58:27+00:00 2026-05-27T05:58:27+00:00

What is wrong with this class? My progressdialog is shown but stays at 0%

  • 0

What is wrong with this class? My progressdialog is shown but stays at 0% then disappears, it never gets percentage updates

public class AsyncLogin extends AbstractAsync {


    public AsyncLogin(Context context, AsyncCallback mAuthcallback) {
        super(context, mAuthcallback);
    }

    @Override
    protected HashMap<String, String> doInBackground(String... args) {
        ...
        publishProgress(50);

        HashMap<String, String> result = html.download();
        publishProgress(75);
        return result;
    }

    protected void onPreExecute() {
        super.onPreExecute();

        this.progressDialog.setMessage(this.context.getString(R.string.please_wait_logging_in));
        this.progressDialog.show();


        publishProgress(25);
    }


    protected void onProgresUpdate(Integer...  progress)
    {
        super.onProgressUpdate(progress);
        Log.v("max", "set progress" + progress[0]);
        this.progressDialog.setProgress(progress[0]);
    }

    protected void onPostExecute(HashMap map) {
        ...
    }

}


abstract class AbstractAsync extends AsyncTask <String, Integer, HashMap>{


    protected Context context;
    protected ProgressDialog progressDialog;
    protected AsyncCallback mAuthcallback;

    public AbstractAsync(Context context, AsyncCallback mAuthcallback) {
        this.context = context;
        this.mAuthcallback = mAuthcallback;

        progressDialog = new ProgressDialog(context);
        progressDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
        progressDialog.setCancelable(false);
        progressDialog.setProgress(0);
    }


    protected void onPreExecute()
    {
        super.onPreExecute();
        progressDialog.setMessage(context.getString(R.string.loadingSomething).toString());
        //dialog.show();
    }

    protected void onProgresUpdate(Integer...  progress)
    {
        super.onProgressUpdate(progress);
        Log.v("max", "set progress" + progress[0]);
        progressDialog.setProgress(progress[0]);
    }


    protected void onPostExecute(HashMap result)
    {
        super.onPostExecute(result);
        progressDialog.dismiss();
    }

}

The log never writes anything

  • 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-27T05:58:27+00:00Added an answer on May 27, 2026 at 5:58 am

    Any chance your log level is lower than verbose?

    Any chance your method never reaches “publishProgress”?

    Also, you are not supposed to call publishProgress in onPreExecute. The first is to be called on the backgorund thread that runs your doInBackground, the second is called by the asynctacsk mechanism before starting the bg thread.

    Would you post AbstractAsync code just in case?

    EDIT:

    onProgresUpdate
    

    is actually to be spelled

    onProgressUpdate
    

    Free Tip: use @Override annotation to make sure you are actually overriding something

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

Sidebar

Related Questions

I'm calling this linear class relationship , but correct me if I'm wrong. I'm
Maybe I'm thinking about this the wrong way but here's the idea: Class A
Can anyone tell me what's wrong with this code? class Dataset < ActiveRecord::Base has_many
There is something wrong with this trigger. But what? CREATE TRIGGER MYCOOLTRIGGER AFTER INSERT
A have a class hierarchy that looks somethign like this: class AbstractDataType { public:
What's wrong with this class? <?php class myClass { private $dbServer = 'localhost'; private
I have a class that gets arranged into a hierarchy, such as this: class
Given this class: class Tacobell{ public function order_taco(){ echo 3 Tacos, thank you.; }
What is wrong in this class in CoffeeScript ?? @module Euclidean2D, -> class @Point
Can someone tell me where I am going wrong with this class. It is

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.