Android Guides | Samples

Android.App.Dialog.OnBackPressed Method

Called when the dialog has detected the user's press of the back key.

Syntax

[Android.Runtime.Register("onBackPressed", "()V", "GetOnBackPressedHandler")]
public virtual Void OnBackPressed ()

Remarks

Called when the dialog has detected the user's press of the back key. The default implementation simply cancels the dialog (only if it is cancelable), but you can override this to do whatever you want.

[Android Documentation]

Requirements

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