public class BluetoothDetector extends java.lang.Object implements BluetoothDetectorHandler
| 限定符和类型 | 方法和说明 |
|---|---|
static BluetoothDetectorHandler |
getInstance() |
void |
startScan(BluetoothDetectorCallBack callBack)
开启扫描,并回调至
BluetoothDetectorCallBack.onScan(BluetoothDevice, int, byte[]) 方法
此方法调用请放在 Activity.onCreate(Bundle) 方法里执行
与 BluetoothDetectorHandler.stopScan(BluetoothDetectorCallBack) 方法应是成对出现 |
void |
startScan(BluetoothFilter filter,
BluetoothDetectorCallBack callBack)
开启扫描,并回调至
BluetoothDetectorCallBack.onScan(BluetoothDevice, int, byte[]) 方法
此方法调用请放在 Activity.onCreate(Bundle) 方法里执行
与 BluetoothDetectorHandler.stopScan(BluetoothDetectorCallBack) 方法应是成对出现 |
void |
stopScan(BluetoothDetectorCallBack callBack)
关闭扫描,并移除回调
此方法调用请放在
Activity.onDestroy() 方法里执行
与 BluetoothDetectorHandler.startScan(BluetoothDetectorCallBack) 方法应是成对出现 |
public static BluetoothDetectorHandler getInstance()
public void startScan(BluetoothDetectorCallBack callBack)
BluetoothDetectorHandlerBluetoothDetectorCallBack.onScan(BluetoothDevice, int, byte[]) 方法
此方法调用请放在 Activity.onCreate(Bundle) 方法里执行
与 BluetoothDetectorHandler.stopScan(BluetoothDetectorCallBack) 方法应是成对出现startScan 在接口中 BluetoothDetectorHandlerpublic void startScan(BluetoothFilter filter, BluetoothDetectorCallBack callBack)
BluetoothDetectorHandlerBluetoothDetectorCallBack.onScan(BluetoothDevice, int, byte[]) 方法
此方法调用请放在 Activity.onCreate(Bundle) 方法里执行
与 BluetoothDetectorHandler.stopScan(BluetoothDetectorCallBack) 方法应是成对出现startScan 在接口中 BluetoothDetectorHandlerpublic void stopScan(BluetoothDetectorCallBack callBack)
BluetoothDetectorHandlerActivity.onDestroy() 方法里执行
与 BluetoothDetectorHandler.startScan(BluetoothDetectorCallBack) 方法应是成对出现stopScan 在接口中 BluetoothDetectorHandler