Language

Activity.ShowDialog Method

Definition

Overloads

Name Description
ShowDialog(Int32)
Obsolete.

Simple version of #showDialog(int, Bundle) that does not take any arguments.

ShowDialog(Int32, Bundle)
Obsolete.

Show a dialog managed by this activity.

ShowDialog(Int32)

Caution

deprecated

Simple version of #showDialog(int, Bundle) that does not take any arguments.

[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

Show a dialog managed by this activity.

[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

The id of the managed dialog.

args
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

Returns true if the Dialog was created; false is returned if it is not created because #onCreateDialog(int, Bundle) returns false.

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