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. Adding Classes in Android.jar

Hi Experts,

 

I am planning to add my a class files in Android.jar [Windows]

 

Can u please help me in this regards

I tested adding into Android.jar and I didn't helped me

 

With regards

Syed


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

2. Presumably there's no method to apply permissions to your code during runtime, correct?

The only methods for doing this are in the manifest, presumably to
make *.apk installation simpler.

It would be great if the *.apk installer could grep the *.apk for
security permission requests and operate exactly how it does now.

This way you can write re-usable code that others can use without
having to modify their manifests and yet the same security model gets
enforced.

Comments, secure workarounds...?

     Hans
--~--~---------~--~----~------------~-------~--~----~

3. Accessing Dialog buttons

4. How to show content in system?

5. TextView scrolling (in case anyone finds this useful)

6. How do I remove/disable the bar displaying the app name.

7. remove|delete res/raw files