Android Guides | Samples

Android.App.Dialog.SetOnCancelListener Method

Set a listener to be invoked when the dialog is canceled.

Syntax

[Android.Runtime.Register("setOnCancelListener", "(Landroid/content/DialogInterface$OnCancelListener;)V", "GetSetOnCancelListener_Landroid_content_DialogInterface_OnCancelListener_Handler")]
public virtual Void SetOnCancelListener (IDialogInterfaceOnCancelListener listener)

Parameters

listener
The IDialogInterfaceOnCancelListener to use.

Remarks

Set a listener to be invoked when the dialog is canceled.

This will only be invoked when the dialog is canceled. Cancel events alone will not capture all ways that the dialog might be dismissed. If the creator needs to know when a dialog is dismissed in general, use Dialog.SetOnDismissListener(IDialogInterfaceOnDismissListener).

[Android Documentation]

Requirements

Namespace: Android.App
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 1