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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T13:29:24+00:00 2026-05-26T13:29:24+00:00

I am new to Android. In my application I want to add an process

  • 0

I am new to Android. In my application I want to add an process bar(an image), this should indicate that something is in process and after completion hide this precess bar.

As if i add user detail, On click on add button this process bar should be displayed.

How can i do it, please suggest.

Thanks.

Code I used:

progressDialog = ProgressDialog.show(AddTicketActivity.this, "", "Loading...");

                new Thread() {

                public void run() {

                try{

                sleep(10000);

                } catch (Exception e) {

                Log.e("tag", e.getMessage());

                }

                progressDialog.dismiss();
                }

            }.start();

The problem with it is , it is hardcoded sleep(10000) whereas what i want is it to be dependent on how much time my process takes to add or fetch data.

I am not getting where to put code which is executing on onclick of button.

I hope you got my point

Thanks again.

  • 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-26T13:29:25+00:00Added an answer on May 26, 2026 at 1:29 pm

    For that you can use either ProgressDialog or ProgressBar.

    Now, To display Progress bar and during that perform task in background, you should implement AsyncTask.

    1. In onPreExecute() method, display the ProgressBar or make it visible again like: progressbar.setVisibility(View.VISIBLE);
    2. In doInBackground() method, perform the background task, i.e. add user detail in your case
    3. In onPostExecute() method, just hide the ProgressBar using the progressbar.setVisibility(View.INVISIBLE);
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want add new fonts for Android. I found a tutorial that asks me
We are designing a new application for Android and we want to make it
i m new to this android application development i would be very much grateful
I am new to Android. I have tried an sample application for status bar
I am new to Android. I want to add one Menu by pressing the
I want to implement a search in my Android application. In this page, first
I want to create a custom logger for android application. The logging should be
I want to add a non-native shared library to Android so every application on
I am new in Android. I want to add one custom Confirmation before uninstall
I am building android application now i already completed, but I want to add

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.