Android.Bluetooth.BluetoothAdapter.CancelDiscovery Method
Cancel the current device discovery process.

Syntax

[Android.Runtime.Register("cancelDiscovery", "()Z", "")]
public bool CancelDiscovery ()

Returns

Documentation for this section has not yet been entered.

Remarks

Cancel the current device discovery process.

Requires NoType:android/Manifest$permission;Href=../../../reference/android/Manifest.permission.html#BLUETOOTH_ADMIN.

Because discovery is a heavyweight procedure for the Bluetooth adapter, this method should always be called before attempting to connect to a remote device with BluetoothSocket.Connect. Discovery is not managed by the Activity, but is run as a system service, so an application should always call cancel discovery even if it did not directly request a discovery, just to be sure.

If Bluetooth state is not BluetoothAdapter.STATE_ON, this API will return false. After turning on Bluetooth, wait for BluetoothAdapter.ActionStateChanged with BluetoothAdapter.STATE_ON to get the updated value.

[Android Documentation]

Requirements

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