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. Why my gallery on real device behave so oddly?

Hi All,

I play with android on my real device.

1. Given there is six icons in the gallery sceen, no matter what icon
I click, it always show me the first icon image.

2. On the image display, the left and right side has a TRIANGLE , on
emulator, for a pull-click, it can response to next/previous image,
however on my device , it doesn't work. Please note, My touch screen
is working .But if I press "DOWN" button in the keyboard, it can move
to next image.

3. When display to last image, keyboard UP can not move to previous
image, while in emulator, it can do like that.


I feel very puzzled, is there any environment or property is not set,
or something else error happened?


Max
--~--~---------~--~----~------------~-------~--~----~

2. How do you get the local time zone?

Hi,

I can't figure out how to get the local time zone...

TimeZone.getDefault() returns Pacific Time, while my phone's settings
show the time zone correctly set to EST.

Thanks
-Ben
--~--~---------~--~----~------------~-------~--~----~

3. TERRIBLE BUG IN MARKET APPLICATION (was Paid apps related questions discussion list?)

4. TERRIBLE BUG IN MARKET APPLICATION (was Paid apps related questions discussion list?)

5. Activity.onRetainNonConfigurationInstance() called after onStop() and onPause() - too late to be relevant?

6. replacing open core

7. Map 3D View