Problem with ProgressDialog

by rustyventure » Sat, 14 Mar 2009 02:19:15 GMT


Sponsored Links
 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:


OnClickListener updateButtonPressed = new OnClickListener(){
        // @Override
        public void onClick(View arg0) {


                //Run this on a new thread
                runOnUiThread(new Runnable() {

                        @Override
                        public void run() {
                                // TODO Auto-generated method stub

                                ProgressDialog pd = null;

                                pd = ProgressDialog.show(myContext, "please 
wait", "updating",
true, false);

                                /*
                                 run a bunch of code ...
                                */

                                pd.dismiss();

                        }

                });



        }
    };


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?



--~--~---------~--~----~------------~-------~--~----~



Problem with ProgressDialog

by sync qa3 » Sun, 15 Mar 2009 13:13:13 GMT


 FgfcccbvfCfkgcghbxh gy





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:


OnClickListener updateButtonPressed = new OnClickListener(){
       // @Override
       public void onClick(View arg0) {


               //Run this on a new thread
               runOnUiThread(new Runnable() {

                       @Override
                       public void run() {
                               // TODO Auto-generated method stub

                               ProgressDialog pd = null;

                               pd = ProgressDialog.show(myContext, "please
wait", "updating",
true, false);

                               /*
                                run a bunch of code ...
                               */

                               pd.dismiss();

                       }

               });



       }
   };


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?




--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


Problem with ProgressDialog

by Hermes Pique » Sun, 15 Mar 2009 18:53:32 GMT


 I had the same problem. I don't know if it's the wrong way to do it,
but not using runOnUiThread and calling start on the thread fixed it
for me. I guess that if you run the thread in the UI, the thread is
run inmmediatly, preventing the progess dialog from showing up.

You migth need to use a handler to communicate with the UI thread.

Let me know if that works.

Best,

Hermes.



--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. Using glColor4x

Anyone used glColor4x much?

I am passing colours into a line draw rtn in the usual format '4
bytes: alpha, red, green, blue.'

my call to to set the colour attempts to modify the RRGGBB parts into
fixed format values.

        int red = (color&0x00FF0000);
        int green = (color&0x0000FF00)<<8;
        int blue = (color&0x000000FF)<<16;

        surface.glColor4x(red, green, blue, 0);

I am getting screwy colours from this. I have searched but there
aren't many examples of this call kicking around and used in this way.
I am obviously doing something dumb. Do I have to format the rgb
values as percentages somehow?

'surface' is defined as GL10 btw.

Al.
--~--~---------~--~----~------------~-------~--~----~

2. How can I add a new adb command?

Because I want to develop Android debug tools in Android, I want to
via adb interface. How can I add a new adb command? Thanks for your
help.

--~--~---------~--~----~------------~-------~--~----~
unsubscribe: android-kernel+unsubscr...@googlegroups.com
website: 

3. Looking for tutorials about java.util.Date class

4. Preventing a contact from being added to system group

5. How can I get current SDK version in my program code ?

6. Unable to play youtube videos on SDK 1.5 emulator, but playing well on SDK 1.0 emulator

7. Unable to play youtube videos on SDK 1.5 emulator, but playing well on SDK 1.0 emulator