me--
me--

Reputation: 2148

Android Bluetooth scan - how to know when it's finished?

I'm using the startScan method of a BluetoothLeScanner to collect information about available devices. However, I need to know when the scan has finished. There are no methods in the callback that seem to indicate this.

How can I know when the scan has completed?

Upvotes: 1

Views: 1928

Answers (1)

Pararth
Pararth

Reputation: 8134

You can use stopScan() when you complete the functionality for scanning devices.
So it is more like the scan completes when you want it to, depending on whether you would want the scan to stop based on a time criteria or say after a few devices are found.

The decision point to do that would be ScanCallback functions and results.
ScanResult can help.

Upvotes: 3

Related Questions