| | |
| | | /** |
| | | * 如果连接状态,断开重新连接 |
| | | */ |
| | | if (MainApp.theApp.bleManager != null && MainApp.theApp.bleManager.isConnected()) { |
| | | mBluetoothService.closeConnect(); |
| | | if (MainApp.theApp.bleManager != null) { |
| | | MainApp.theApp.bleManager.closeBluetoothGatt(); |
| | | } |
| | | mBluetoothService.connectDevice(scanResultList.get(position)); |
| | | } |
| | |
| | | if (ActivityManager.getActivityManager().isActivityExist(BLESearchActivity.this.getClass().getName())) { |
| | | progressDialog.dismiss(); |
| | | } |
| | | Log.d("chonglian","连接失败"); |
| | | // Log.d("chonglian","连接失败"); |
| | | mToatUtils.showSingletonToast("连接失败"); |
| | | EventMessage msg = new EventMessage(); |
| | | msg.setType(AppConfig.GET_BLE_DISCONNECT); |