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. Problem with the ImageView to Gris Scala

Hi All

I have the following problem, when executed this code.

                        imageView.setDrawingCacheEnabled(true);
                 Bitmap myBitmap = imageView.getDrawingCache();
                 ColorMatrix colorMatrix = new ColorMatrix();
                 colorMatrix.setSaturation(0);
                 Paint paint = new Paint();
                 ColorMatrixColorFilter cmcf = new
ColorMatrixColorFilter(colorMatrix);
                 paint.setColorFilter(cmcf);
                 Bitmap blackAndWhiteBitmap =
Bitmap.createBitmap(myBitmap.getWidth(),myBitmap.getHeight(),
Bitmap.Config.ARGB_8888);
                 Canvas drawingCanvas = new Canvas(blackAndWhiteBitmap );
                 drawingCanvas.drawBitmap(myBitmap, 0, 0, paint);
                 imageView.setImageBitmap(blackAndWhiteBitmap);
                 imageView.setDrawingCacheEnabled(false);
                 flagColor= false;


It code is for convert the ImageView to gris scala , and the question is if
exist some way from return the image in your correct colors

I can make the copy from Bitmap with these code before the converting the
image to gris scala  and after make the restore

bitmap = myBitmap.copy(Bitmap.Config.ARGB_8888, true);

but if the image is reduced or enlarged, and want restored to correct color,
the image lose these changes.

Exist some way from that with the copy prior from the Image,  can captured
your colors and after set these colors to new image changed

Thanks
David

-- 

2. Gift apps page for android

Exits a Gift Page to pay for apps aand sent the app to my friends??

Iphone have this mode in the AppStore but I dont know if Android have
it.

Thanks for your time.

-- 

3. SD Card access for utility app

4. Selecting languages to list in for Android Market

5. Android Javadoc in eclipse

6. Spinner displays first item instead of selected item

7. Custom View changing size