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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T01:03:03+00:00 2026-05-16T01:03:03+00:00

Can I use progress bar in android, without the thread? HERE IS CODE OF

  • 0

Can I use progress bar in android, without the thread?

HERE IS CODE OF MY CURRENT WAY OF IMPLEMENTING PROGRESS DIALOG

            //              Adding Progress bar

            String[][] data;    //Global variable

//called on onCreate() or onItemSelected

            final ProgressDialog myProgressDialog;

            myProgressDialog = ProgressDialog.show(ListingPage.this,"Please Wait", "Loading Date", true);
            new Thread() {
                public void run() {
                    try{

                        setSelected();

                        sleep(5000);
                    } catch (Exception e) { }

                    myProgressDialog.dismiss();
                }
            }.start();


            populateList(Split.splitToTwoDimArray(data));   // populates the list view

HOPE ABOVE HELPS, IF USING THREAD THE LIST IS NOT BEING POPULATED.

  • 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-16T01:03:04+00:00Added an answer on May 16, 2026 at 1:03 am

    Sure, you can always set the progress manually via

    progressBar.setProgress(int progress);
    

    Above question/added code is a bit confusing cause you asked how to use the progress bar without a thread but now in your code you’re using a thread. I thought that you initially wanted to avoid.

    Anyway, maybe you should use an AsyncTask instead of the Thread, which allows you to modify anything in the main UI thread.

    https://sites.google.com/site/androidhowto/how-to-1/create-a-custom-progress-bar-using-asynctask

    http://developer.android.com/reference/android/os/AsyncTask.html

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

Sidebar

Ask A Question

Stats

  • Questions 491k
  • Answers 491k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Looking at recent Clang commits reveals that C++ precompiled header… May 16, 2026 at 10:07 am
  • Editorial Team
    Editorial Team added an answer I wold create a control named for example InfoProgresBar, that… May 16, 2026 at 10:07 am
  • Editorial Team
    Editorial Team added an answer According to this code it seems that the user that… May 16, 2026 at 10:07 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

i need to use Progress bar in my application. It takes more than two
I want to use progress bar to show file upload progress. I'm currently using
I can't use wx.ProgressDialog because I need to add extra contents to the dialog
In XUL you can use create a status bar panel icon, similar to the
I am writing for Android, and I can't figure out how to replicate the
I want to use a custom media controller in my Android app and therefore
I am building a file upload progress bar. Currently I have an upload form
In many applications, we have some progress bar for a file download, for a
How can I use globalCompositeOperation for erasing something? http://canvaspaint.org/ has an eraser, but that's
I know I can use System.Environment.ProcessorCount to return the number of processors in a

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.