DialogFragment.OnCreateDialog(Bundle) Method

Definition

Override to build your own custom Dialog container.

[Android.Runtime.Register("onCreateDialog", "(Landroid/os/Bundle;)Landroid/app/Dialog;", "GetOnCreateDialog_Landroid_os_Bundle_Handler")]
public virtual Android.App.Dialog? OnCreateDialog (Android.OS.Bundle? savedInstanceState);
[<Android.Runtime.Register("onCreateDialog", "(Landroid/os/Bundle;)Landroid/app/Dialog;", "GetOnCreateDialog_Landroid_os_Bundle_Handler")>]
abstract member OnCreateDialog : Android.OS.Bundle -> Android.App.Dialog
override this.OnCreateDialog : Android.OS.Bundle -> Android.App.Dialog

Parameters

savedInstanceState
Bundle

The last saved instance state of the Fragment, or null if this is a freshly created Fragment.

Returns

Return a new Dialog instance to be displayed by the Fragment.

Attributes

Remarks

Override to build your own custom Dialog container. This is typically used to show an AlertDialog instead of a generic Dialog; when doing so, #onCreateView(LayoutInflater, ViewGroup, Bundle) does not need to be implemented since the AlertDialog takes care of its own content.

This method will be called after #onCreate(Bundle) and before #onCreateView(LayoutInflater, ViewGroup, Bundle). The default implementation simply instantiates and returns a Dialog class.

<em>Note: DialogFragment own the Dialog#setOnCancelListener Dialog.setOnCancelListener and Dialog#setOnDismissListener Dialog.setOnDismissListener callbacks. You must not set them yourself.</em> To find out about these events, override #onCancel(DialogInterface) and #onDismiss(DialogInterface).

Java documentation for android.app.DialogFragment.onCreateDialog(android.os.Bundle).

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