This seems to show the dialog fine in some quick tests:
public class TestProgressDialog extends Activity {

        private static final int ID_DIALOG_X = 1;

        @Override
        public void onCreate(Bundle savedInstanceState) {
                super.onCreate(savedInstanceState);
                showDialog(ID_DIALOG_X);
        }

        @Override
        protected Dialog onCreateDialog(int id) {
                if (id == ID_DIALOG_X) {
                        ProgressDialog pg = new ProgressDialog(this);
                        pg.setMessage("Loading..");
                        return pg;
                }
                return super.onCreateDialog(id);
        }

}

Are you calling showDialog from a different thread, maybe? What
version of Android are you using?

On Oct 27, 9:26 pm, Greg Donald <[email protected]> wrote:
> I'm having problems getting showDialog() to show anything.
>
> I have this for my onCreateDialog() callback:
>
> private static final int ID_DIALOG_X = 1;
>
> protected Dialog onCreateDialog(int id) {
>  if (id == ID_DIALOG_X) {
>    ProgressDialog pg = new ProgressDialog(this);
>      pg.setMessage("Loading..");
>      return pg;
>  }
>  return super.onCreateDialog(id);
>
> }
>
> And then I'm calling it like this:
>
> showDialog(ID_DIALOG_X);
>
> But nothing shows up, no errors either.
>
> Using ddms and Log.i() I can see my onCreateDialog() is being
> executed, the new progress dialog gets created, but then nothing shows
> up.
>
> Any ideas?  TIA.
>
> --
> Greg Donaldhttp://destiney.com/
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to