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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T21:17:28+00:00 2026-05-31T21:17:28+00:00

I am on a dilemma on how to achieve Creating a loading screen on

  • 0

I am on a dilemma on how to achieve “Creating a loading screen” on a AsyncTask mainly using progressDialog.

What I am doing is that I have a method which takes no inputs and just shows a textview.

private class DownloadFilesTask extends AsyncTask {

So what my method does is simply like 1 + 1 = 2 but in a more complex way of storing a giganormous string which then get shown on a textview.

So my question is how do I achieve the result of a progress dialog before this long load?

  • 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-31T21:17:29+00:00Added an answer on May 31, 2026 at 9:17 pm
    private progressDialog pd;
    public void runMethod(){
    new doStuuff.execute();
    }
    
    
    private Class doStuff extends AsyncTask<Void, Void, Void>{
    
            @Override
            protected Void doInBackground(Void... params) {
    //Everything in your code except for anything that is xml or relates with any view. Mostly calculations
                return null;
            }
    
            @Override
            protected void onPostExecute(Void result) {
                // TODO Auto-generated method stub
    //Your main background view code ends up falling here
                pd.dismiss();
            }
    
            @Override
            protected void onPreExecute() {
                // TODO Auto-generated method stub
    //Your optional view and where it starts
    pd = ProgressDialog.show(View_Book_As_Whole.this, "Loading", "Please wait...");
            }
    
    }
    

    I was being too noob not to understand the concept but it is relatively easy once you understand it. onPreExecute() means that it runs before anything and it takes priority first then goes to doInBackground(), and then onPostExecute() it runs the final task. This all works in the background of the UI.

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

Sidebar

Related Questions

The dilemma I'm using a before_filter in my controller that restricts access to admins.
We have a dilemma; developing desktop application using Matisse or Jigloo.. Matisse has this
I have a dilemma that I've encountered before. What's the best in terms of
I am using the jQuery UISlider. I have it set up so that upon
I have a difficult dilemma. I implemented a java application using Netbeans while implementing
I have a strange dilemma.... First of all, I am stuck using XPath 1.0
I have a little dilemma that maybe you can help me sort out. I've
Basically my dilemma is this. I have a list of x servers that host
My dilemma - I have a universal app that holds a lot of images
My dilemma is this: I have a PHP page with a form that includes

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.