Taal

Activity.OnCreateDialog Method

Definition

Overloads

Name Description
OnCreateDialog(Int32)
Obsolete.

This method was deprecated in API level 15.

OnCreateDialog(Int32, Bundle)
Obsolete.

This method was deprecated in API level 15.

OnCreateDialog(Int32)

Caution

deprecated

This method was deprecated in API level 15.

[Android.Runtime.Register("onCreateDialog", "(I)Landroid/app/Dialog;", "GetOnCreateDialog_IHandler")]
[System.Obsolete("deprecated")]
protected virtual Android.App.Dialog? OnCreateDialog(int id);
[<Android.Runtime.Register("onCreateDialog", "(I)Landroid/app/Dialog;", "GetOnCreateDialog_IHandler")>]
[<System.Obsolete("deprecated")>]
abstract member OnCreateDialog : int -> Android.App.Dialog
override this.OnCreateDialog : int -> Android.App.Dialog

Parameters

id
Int32

int

Returns

Attributes

Remarks

This method was deprecated in API level 15. Old no-arguments version of onCreateDialog(int,Bundle).

Android reference for android.app.Activity.onCreateDialog.

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

OnCreateDialog(Int32, Bundle)

Caution

deprecated

This method was deprecated in API level 15.

[Android.Runtime.Register("onCreateDialog", "(ILandroid/os/Bundle;)Landroid/app/Dialog;", "GetOnCreateDialog_ILandroid_os_Bundle_Handler")]
[System.Obsolete("deprecated")]
protected virtual Android.App.Dialog? OnCreateDialog(int id, Android.OS.Bundle? args);
[<Android.Runtime.Register("onCreateDialog", "(ILandroid/os/Bundle;)Landroid/app/Dialog;", "GetOnCreateDialog_ILandroid_os_Bundle_Handler")>]
[<System.Obsolete("deprecated")>]
abstract member OnCreateDialog : int * Android.OS.Bundle -> Android.App.Dialog
override this.OnCreateDialog : int * Android.OS.Bundle -> Android.App.Dialog

Parameters

id
Int32

int: The id of the dialog.

args
Bundle

Bundle: The dialog arguments provided to showDialog(int,Bundle).

Returns

The dialog. If you return null, the dialog will not be created.

Attributes

Remarks

This method was deprecated in API level 15. Use the new DialogFragment class with FragmentManager instead; this is also available on older platforms through the Android compatibility package.

Callback for creating dialogs that are managed (saved and restored) for you by the activity. The default implementation calls through to onCreateDialog(int) for compatibility. If you are targeting Build.VERSION_CODES.HONEYCOMB or later, consider instead using a DialogFragment instead. If you use showDialog(int), the activity will call through to this method the first time, and hang onto it thereafter. Any dialog that is created by this method will automatically be saved and restored for you, including whether it is showing. If you would like the activity to manage saving and restoring dialogs for you, you should override this method and handle any ids that are passed to showDialog(int). If you would like an opportunity to prepare your dialog before it is shown, override onPrepareDialog(int,Dialog,Bundle).

See also:

Android reference for android.app.Activity.onCreateDialog.

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