Freigeben über


BluetoothAdapter.IsDiscovering Property

Definition

Return true if the local Bluetooth adapter is currently in the device discovery process.

public bool IsDiscovering { [Android.Runtime.Register("isDiscovering", "()Z", "")] [Android.Runtime.RequiresPermission("android.permission.BLUETOOTH_SCAN")] get; }
[<get: Android.Runtime.Register("isDiscovering", "()Z", "")>]
[<get: Android.Runtime.RequiresPermission("android.permission.BLUETOOTH_SCAN")>]
member this.IsDiscovering : bool

Property Value

true if discovering

Attributes

Remarks

Return true if the local Bluetooth adapter is currently in the device discovery process.

Device discovery is a heavyweight procedure. New connections to remote Bluetooth devices should not be attempted while discovery is in progress, and existing connections will experience limited bandwidth and high latency. Use #cancelDiscovery() to cancel an ongoing discovery.

Applications can also register for #ACTION_DISCOVERY_STARTED or #ACTION_DISCOVERY_FINISHED to be notified when discovery starts or completes.

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

Java documentation for android.bluetooth.BluetoothAdapter.isDiscovering().

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