Activity.ShowDialog Method

Definition

Overloads

Name Description
ShowDialog(Int32)
Obsolete.

This method was deprecated in API level 15.

ShowDialog(Int32, Bundle)
Obsolete.

This method was deprecated in API level 15.

ShowDialog(Int32)

Caution

deprecated

This method was deprecated in API level 15.

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

Parameters

id
Int32

int

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.

Simple version of showDialog(int,Bundle) that does not take any arguments. Simply calls showDialog(int,Bundle) with null arguments.

Android reference for android.app.Activity.showDialog.

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

ShowDialog(Int32, Bundle)

Caution

deprecated

This method was deprecated in API level 15.

[Android.Runtime.Register("showDialog", "(ILandroid/os/Bundle;)Z", "")]
[System.Obsolete("deprecated")]
public bool ShowDialog(int id, Android.OS.Bundle? args);
[<Android.Runtime.Register("showDialog", "(ILandroid/os/Bundle;)Z", "")>]
[<System.Obsolete("deprecated")>]
member this.ShowDialog : int * Android.OS.Bundle -> bool

Parameters

id
Int32

int: The id of the managed dialog.

args
Bundle

Bundle: Arguments to pass through to the dialog. These will be saved and restored for you. Note that if the dialog is already created, onCreateDialog(int,Bundle) will not be called with the new arguments but onPrepareDialog(int,Dialog,Bundle) will be. If you need to rebuild the dialog, call removeDialog(int) first.

Returns

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.

Show a dialog managed by this activity. A call to onCreateDialog(int,Bundle) will be made with the same id the first time this is called for a given id. From thereafter, the dialog will be automatically saved and restored. If you are targeting Build.VERSION_CODES.HONEYCOMB or later, consider instead using a DialogFragment instead. Each time a dialog is shown, onPrepareDialog(int,Dialog,Bundle) will be made to provide an opportunity to do any timely preparation.

See also:

Android reference for android.app.Activity.showDialog.

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