次の方法で共有


Activity.RemoveDialog(Int32) Method

Definition

Caution

deprecated

Removes any internal references to a dialog managed by this Activity.

[Android.Runtime.Register("removeDialog", "(I)V", "")]
[System.Obsolete("deprecated")]
public void RemoveDialog (int id);
[<Android.Runtime.Register("removeDialog", "(I)V", "")>]
[<System.Obsolete("deprecated")>]
member this.RemoveDialog : int -> unit

Parameters

id
Int32

The id of the managed dialog.

Attributes

Remarks

Removes any internal references to a dialog managed by this Activity. If the dialog is showing, it will dismiss it as part of the clean up.

This can be useful if you know that you will never show a dialog again and want to avoid the overhead of saving and restoring it in the future.

As of android.os.Build.VERSION_CODES#GINGERBREAD, this function will not throw an exception if you try to remove an ID that does not currently have an associated dialog.

This member is deprecated. Use the new DialogFragment class with FragmentManager instead; this is also available on older platforms through the Android compatibility package.

Java documentation for android.app.Activity.removeDialog(int).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

See also

  • <xref:Android.App.Activity.OnCreateDialog(System.Int32%2c+Android.OS.Bundle)>
  • <xref:Android.App.Activity.OnPrepareDialog(System.Int32%2c+Android.App.Dialog%2c+Android.App.Dialog)>
  • ShowDialog(Int32)
  • DismissDialog(Int32)