FastBle icon indicating copy to clipboard operation
FastBle copied to clipboard

退出app后就会断开连接,不知道哪里出了问题

Open jxxp opened this issue 3 years ago • 1 comments

没有调用, BleManager.getInstance().disconnectAllDevice();BleManager.getInstance().destroy(); 断开连接的任务方法。

@Override
protected void onDestroy() {
    super.onDestroy();

// BleManager.getInstance().disconnectAllDevice(); // BleManager.getInstance().destroy(); Log.d("MainActivity", "onDestroy"); }

jxxp avatar Sep 30 '22 02:09 jxxp

断开连接

1.如果没有主动断开连接,想保活。试试把连接放在服务里,用startForegroundService 和Notification搭配使用。

2.如果连接上,一直有数据交互,切换后台不会断开,不会杀死。

Wheats avatar Oct 17 '22 06:10 Wheats