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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T07:52:47+00:00 2026-05-23T07:52:47+00:00

Im having trouble making things happen in order instead of together in android. For

  • 0

Im having trouble making things happen in order instead of together in android.

For instance when a user clicks a Button, I want a ProgressDialog to be displayed first, then dismissed, and then TextView changed. Would I need to make a method for each of these or is it something i can implement to make this happen.

Thanks for anyone who helps.

  • 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-23T07:52:47+00:00Added an answer on May 23, 2026 at 7:52 am

    You can use an AsyncTask to accomplish this. Override doInBackground and use publishProgress and onProgressUpdate to update your progress bar. Then, in onPostExecute, update your TextView.

    An example (without the publishProgress and onProgressUpdate):

        mTextView = (TextView) findViewById(R.id.text1);
    
        new AsyncTask<Void, Integer, Void>() {
            private ProgressDialog mProgressDialog;
    
            @Override
            protected Void doInBackground(Void... arg0) {
                try {
                    Thread.sleep(5000);
                } catch (InterruptedException e) {
                    // TODO Auto-generated catch block
                    e.printStackTrace();
                }
                return null;
            }
    
            @Override
            protected void onPostExecute(Void result) {
                mTextView.setText("All Done");
                mProgressDialog.dismiss();
            }
    
            @Override
            protected void onPreExecute() {
                mProgressDialog = ProgressDialog.show(Welcome.this, "Progress title", "Progress message", true);
            }
    
        }.execute((Void) null);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Im having trouble making sure my active graphic is positioned outside of the button,
I'm having trouble making this simple thing happen. I have this loop adding values
Im having trouble making my table contents vertically aligned and was wondering if you
I'm having trouble making a secure FTP connection using SharpSSH. Up to now I've
I am a bit of an ant newbie, and I'm having trouble making a
I'm having trouble with making a subdomain to my Windows computer while using AJP
I'm having a trouble making a re-sizable rectangle for cropping my images. I'm trying
I'm having a little bit of trouble making a sticky form that will remember
I'm having trouble with the way I designed this little report I'm making. Is
I'm having serious trouble figuring out what is making certain function calls ambiguous and

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.