| | |
| | | if (MainApp.theApp.bleManager != null) { |
| | | MainApp.theApp.bleManager.closeBluetoothGatt(); |
| | | } |
| | | mBluetoothService.scanAndConnect5(scanResultList.get(position).getDevice().getAddress()); |
| | | mBluetoothService.connectDevice(scanResultList.get(position)); |
| | | EventMessage eventMessage = new EventMessage(); |
| | | eventMessage.setType(AppConfig.BLUETOOCH_CHANGE_CONNECT); |
| | | EventBus.getDefault().post(eventMessage); |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | @Override |
| | | protected void initListener() { |
| | | iv_search.setOnClickListener(this); |
| | | // iv_search.setOnClickListener(this); |
| | | iv_searchpic.setOnClickListener(this); |
| | | } |
| | | |
| | | @Override |
| | |
| | | @Override |
| | | protected void processClick(View view) { |
| | | switch (view.getId()) { |
| | | case R.id.iv_search: |
| | | case R.id.iv_searchpic: |
| | | mBluetoothService.openBlueTooth(); |
| | | if (isScan) { |
| | | if (mBluetoothService != null) { |
| | | mBluetoothService.cancelScan(); |
| | |
| | | progressDialog.dismiss(); |
| | | finish(); |
| | | } |
| | | |
| | | } |
| | | }; |
| | | |