You can close a dialog using its dismiss() method :
http://developer.android.com/intl/fr/reference/android/app/Dialog.html#dismiss%28%29

You might want to consider having the activity manage restoring your
dialog for you as well:
http://developer.android.com/intl/fr/reference/android/app/Activity.html#onCreateDialog%28int%29

On Oct 24, 4:45 am, Neilz <[email protected]> wrote:
> Oh well. Maybe I should raise it as a bug, as this is a problem to me,
> and it seems there should be a standard method to the effect of
> alert.close();
>
> On Oct 23, 1:02 pm, Neilz <[email protected]> wrote:
>
> > Hi. I have an activity which pops up a Dialog box, to get some text
> > input from the user. The problem arises when you switch orientation.
> > The Dialog disappears, so I have added code to set and check flags in
> > the savedInstanceState, meaning that the Dialog is displayed again in
> > these circumstances.
>
> > However, the dialog isn't being closedgracefullywhen the orientation
> > is switched. I get the following error:
>
> > 10-23 12:53:54.385: ERROR/WindowManager(2852): Activity
> > com.bla.bla.Bla has leaked window
> > com.android.internal.policy.impl.phonewindow$decorv...@435ceda0 that
> > was originally added here
> > 10-23 12:53:54.385: ERROR/WindowManager(2852):
> > android.view.WindowLeaked: Activity com.bla.bla.Bla has leaked window
> > com.android.internal.policy.impl.phonewindow$decorv...@435ceda0 that
> > was originally added here
>
> > I know when the window is going to be closed, but can't find a way of
> > closing it manually. I open it with alert.show();  ...but there
> > doesn't seem to be any corresponding alert.destroy() method or
> > similar.
>
> > Any ideas how I can manually close the dialog box without user input?
--~--~---------~--~----~------------~-------~--~----~
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