Problem with ProgressDialog

Put problem concerning Views, Layouts and other XML-Resources (like AndroidManifest) here.

Problem with ProgressDialog

Postby rustyventure » Fri Mar 13, 2009 10:55 pm

(Note: I posted this to android-beginners this morning, but no replies yet, so I'm trying here too :) )

Hi, Everyone:

I'm having some trouble displaying a ProgressDialog. Basically, I want
to show a progress "popup" when a user presses a button in my app.
Here's the code:

Code: Select all
OnClickListener updateButtonPressed = new OnClickListener(){
        // @Override
        public void onClick(View arg0) {
                //Run this on a new thread
                runOnUiThread(new Runnable() {
                        public void run() {
                                // TODO Auto-generated method stub
                                ProgressDialog pd = null;
                                pd =, "please wait", "updating",
true, false);
                                 run a bunch of code ...

The code runs fine, but the popup never appears. I'm using Eclipse as
my development environment, and it logs no errors. As far as I can
tell (and from some google searches), the ProgressDialog should work,
so I'm stumped. Any ideas?
Posts: 5
Joined: Wed Dec 10, 2008 12:14 am


Postby MrSnowflake » Sat Mar 14, 2009 10:23 am

That's probably because /* run a bunch of code */ should be in a separate thread.
User avatar
Posts: 1439
Joined: Sat Feb 16, 2008 3:11 pm
Location: Flanders, Belgium


Return to View, Layout & Resource Problems

Who is online

Users browsing this forum: No registered users and 5 guests