showDialog() fails to show anything

by Greg Donald » Tue, 27 Oct 2009 10:50:30 GMT


Sponsored Links
 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 Donald
 http://destiney.com/ 

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



showDialog() fails to show anything

by Greg Donald » Wed, 28 Oct 2009 16:44:42 GMT


 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 Donald
 http://destiney.com/ 

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


Sponsored Links


showDialog() fails to show anything

by Greg Donald » Wed, 28 Oct 2009 21:28:28 GMT


 



Anyone?



-- 
Greg Donald
 http://destiney.com/ 

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



showDialog() fails to show anything

by qlimax » Wed, 28 Oct 2009 22:15:44 GMT


 have you tried

Dialog pg=new ProgressDialog(this)

then return pg ?

just to try it... and UP this thread...:)





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



showDialog() fails to show anything

by Greg Donald » Wed, 28 Oct 2009 22:21:05 GMT


 



Tried it:

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


Didn't help.


-- 
Greg Donald
 http://destiney.com/ 

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



showDialog() fails to show anything

by Lance Nanek » Thu, 29 Oct 2009 01:56:44 GMT


 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?



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



showDialog() fails to show anything

by Greg Donald » Thu, 29 Oct 2009 14:42:51 GMT


 


Nope, same thread.  I did experiment with runOnUiThread() for a while,
didn't seem to help.


I am using the 1.6 SDK.  I've tried building for both 1.5 and 1.6,
same result, it never shows up.



-- 
Greg Donald
 http://destiney.com/ 

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



Other Threads

1. RIGHT way to kickstart composing a new Calendar event?



There is no public API for that in the SDK. The technique you are using
goes past the bounds of the SDK (as evidenced by references to
"com.android.calendar"), and therefore may fail with some devices, with
newer versions of Android, with third-party calendar apps, etc.:

http://www.androidguys.com/2009/12/14/code-pollution-reaching-past-the-sdk/

Now, it would be nice if there were a consistent API for this, either in
the SDK or simply agreed to by calendar implementers. I'm not completely
clear how to try to arrange such coordination, though.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://twitter.com/commonsguy

_Beginning Android_ from Apress Now Available!

-- 

2. what is wrong here?

Hi,
I registered myself on this mailing list yesterday

I 've send an honnest/serious/polite.. question

so why is this not apearing in the group ?

why don't I see at leas my mail in the list ?

cheers

-- 

3. how easy can the .dex file be reverse engineered?

4. HTC-Developer Center

5. telkomsel sedang masalah ? ato deadline IO scheduler?

6. Setting a built in theme (Theme_Light)

7. Merry Xmas & Happy New Year 2010