我更改了代码
BluetoothAdapter.startLeScan至
BluetoothLeScanner.startScan(callback)所以,我认为扫描性能已经足够高了,但我不知道bluetoothLeScanner扫描时间。
BluetoothAdapter.startLeScan具有不断变化的扫描时间。
请回答。
发布于 2017-02-15 15:03:04
您需要使用处理程序.Use此代码停止扫描,以便在10秒后停止扫描
BluetoothLeScanner.startScan(callback);
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
BluetoothLeScanner.stopScan(callback);
}
}, 10000);https://stackoverflow.com/questions/42241776
复制相似问题