FastBle
FastBle copied to clipboard
退出app后就会断开连接,不知道哪里出了问题
没有调用, BleManager.getInstance().disconnectAllDevice();BleManager.getInstance().destroy(); 断开连接的任务方法。
@Override
protected void onDestroy() {
super.onDestroy();
// BleManager.getInstance().disconnectAllDevice(); // BleManager.getInstance().destroy(); Log.d("MainActivity", "onDestroy"); }
断开连接
1.如果没有主动断开连接,想保活。试试把连接放在服务里,用startForegroundService 和Notification搭配使用。
2.如果连接上,一直有数据交互,切换后台不会断开,不会杀死。