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. find text in page

How do I find text within a page in the browser app?

I use this feature all the time on firefox and its even more important
to be able to search for text on a phone browser where you can only
see a small portion of a web page at a time...

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

2. Drawing a circle outline? (not a filled circle)

Hi,

How can we draw a circle outline in an Overlay? I keep getting a
filled circle with the following code:


    Path outline = new Path();
    outline.addCircle(150, 150, 100, Path.Direction.CW);

    Paint paint = new Paint();
    paint.setColor(0xFF0000);
    paint.setAlpha(255);
    paint.setStrokeWidth(1.0f);

    canvas.drawPath(outline, paint);

I  was kind of expecting it to just be the outline of the circle, not
filled,

Thanks
--~--~---------~--~----~------------~-------~--~----~

3. XMas presents

4. Any way to have two MediaRecorders recording at once?

5. Relative view size or fixed aspect ratio

6. Where to find Jarsigner

7. Does SoundPool work or has anyone successfully used it?