There are at least 2 ways to display a dialog in an activity.
One is to call showDialog, which is managed by the class Activiy. In
this case, to understand the dialog is restored by
onSaveInstanceState / onRestoreInstanceState.
I believed u are talking about this scenrio.

The other is to AlertDialog, with codes like:
                Dialog dialog=new AlertDialog.Builder(mctx)
                .setTitle("about")
                .setMessage("...")
                .setPositiveButton("OK", new DialogInterface.OnClickListener()
{
                        public void onClick(DialogInterface dialog, int 
whichButton)
{
                                return;
                        }
                })
                .create();
                dialog.show();
What I am talking about is this scenario.


On 2月1日, 下午10时26分, Kostya Vasilyev <[email protected]> wrote:
> I'm not a "GUI guru", but I'll try to answer :)
>
> Dialogs are managed by Activity class inside the Android framework.
>
> If a dialog is shown with showDialog(id, [bundle]), it's remembered by
> Activity as being visble, and will be saved by Activity at the same time
> as your onSaveInstanceState / onRestoreInstanceState are called (if you
> have those overrides).
>
> This means that managed dialogs survive orientation changes, as well as
> the activity being destroyed and re-created when the user comes back to
> it (such as with the list of recent applications, called up by [Home]
> long press).
>
> http://developer.android.com/guide/topics/ui/dialogs.html
>
> AFAIK, there is no way to check whether a a given dialog is on the
> screen, although the framework certainly knows this.
>
> -- Kostya
>
> 01.02.2011 16:31, Jian Chen пишет:
>
> > A problem confused me for a little while, which is about dialog
> > window and activity。
>
> > In a normal activity,an alert dialog is called to be shown on top of
> > this activity,and HOME key is pressed to go to HOME screen。
> > Then HOME key is long pressed to go back to this activity。
>
> > Surprisingly, the alert dialog is restored.
> > Is this job done by activity manager?
>
> > A second question is, in some scenarios the activity does not hold the
> > reference, is there a way to index its top window(for example, dialog
> > window) from this activity's API?
> > --
> > You received this message because you are subscribed to the Google
> > Groups "Android Developers" 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-developers?hl=en
>
> --
> Kostya Vasilyev -- WiFi Manager + pretty widget 
> --http://kmansoft.wordpress.com

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" 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-developers?hl=en

Reply via email to