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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T04:37:22+00:00 2026-05-21T04:37:22+00:00

in this app, the user logs in and their credentials are checked against a

  • 0

in this app, the user logs in and their credentials are checked against a server.

The user could be waiting a few seconds, depending on how fast the phone can open a data connection if at all. I need dialog box saying “please wait” or “verifying credentials” or something a long those lines after the user clicks log in.

Desired visual order: press log in -> “please wait” dialog is show in this same activity -> when result comes in from server a new activity is loaded (or error is thrown)

Current visual order: press log in -> user waits as if the app is frozen -> new activity is loaded

I’m trying to do this threading thing with AsyncTask but I’m just not getting it right now!

class Progressor extends AsyncTask<Void, Void, Void> {

ProgressDialog dialog;
    protected void onPreExecute(){
        dialog = ProgressDialog.show(Login.this, "Logging In", 
                "Verifying Credentials, Please wait...", true);
    }

Then in my oncreate method I had all of the other logic like user clicking the button and stuff, but I’ve since moved that into the AsyncTask method’s doInBackGround function

  /* When the Login Button is clicked: */
        Button loginButton = (Button) findViewById(R.id.loginButton);
        loginButton.setOnClickListener(new OnClickListener() {            


            public void onClick(View v) {

                Progressor showMe = new Progressor();
                showMe.onPreExecute();
                showMe.doInBackground(null);
                showMe.onPostExecute();

and onPostExecute simply dismisses the dialog box

Why doesn’t this work and how should it be re-arranged. What variable should I be passing into the showMe.doInBackGround() function, it is void. In debugging it never goes in here

    @Override
    protected Void doInBackground(Void... arg0) {
  • 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-21T04:37:22+00:00Added an answer on May 21, 2026 at 4:37 am

    That isn’t how you use an AsyncTask, have a look at the documentation. Once you have created a new instance of your task, just call execute(), not the individual methods:

    Progressor showMe = new Progressor();
    showMe.execute();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've been beating myself over the head with this app migration for a few
In my web app, when a user logs in, I add his Id to
just wanted to know: In my rails 3 app when a user logs in,
My app is crashing occasionally and when I see the crash logs this is
Why isn't this project maintained anymore? I love this app, however not updating it
Tried something like this: HttpApplication app = s as HttpApplication; //s is sender of
So we have this web app where we support UTF8 data. Hooray UTF8. And
I've got a bunch of servers running this Linux app. I'd like for them
Imagine this directory structure: app/ __init__.py sub1/ __init__.py mod1.py sub2/ __init__.py mod2.py I'm coding
I have this .NET web app that draws a table in Page_Load. Then after

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.