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.
On 13 mar, 19:19, rustyventure goo...@marklinford.com wrote:
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?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Beginners group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
android-beginners-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---