Android蓝牙活页夹已经死了

Android蓝牙活页夹已经死了,android,service,bluetooth,Android,Service,Bluetooth,我有一个Android服务,可以扫描蓝牙低能耗设备。这是可行的,但如果应用程序被关闭,扫描将不起作用。该服务正在运行,但我在日志中看到蓝牙绑定器已失效 D/BtGatt.GattService(3088): Binder is dead - unregistering client (5)! D/BtGatt.GattService(3088): stopScan() - queue=1 D/BtGatt.GattService(3088): stopScan() - queue empty;

我有一个Android服务,可以扫描蓝牙低能耗设备。这是可行的,但如果应用程序被关闭,扫描将不起作用。该服务正在运行,但我在日志中看到蓝牙绑定器已失效

D/BtGatt.GattService(3088): Binder is dead - unregistering client (5)!
D/BtGatt.GattService(3088): stopScan() - queue=1
D/BtGatt.GattService(3088): stopScan() - queue empty; stopping scan
D/BtGatt.btif(3088): btif_gattc_scan
D/BtGatt.btif(3088): btgattc_handle_event: Event 1003
D/BtGatt.GattService(3088): unregisterClient() - clientIf=5
D/BtGatt.btif(3088): btif_gattc_unregister_app
D/BtGatt.btif(3088): btgattc_handle_event: Event 1001
D/BtGatt.btif(3088): btif_gattc_upstreams_evt: Event 1

如何使用服务扫描蓝牙设备?谢谢

与以前的版本不同,在4.4中,将应用程序从最近的任务中移出会永久性地杀死应用程序及其服务(如强制停止),即使它正在运行后台服务。在这里,您可以找到一个“快速而肮脏的解决方法”: