@Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); if (requestCode == 4){ if (mBluetoothController != null){ mBluetoothController.release(); } mBluetoothController.build(this); mBluetoothController.setBluetoothListener(mListener); } }
private void initBT(){ mBluetoothController = BluetoothController.getInstance().build(this); mBluetoothController.setAppUuid(UUID.fromString("fa87c0d0-afac-12de-8a39-0450200c9a66")); mBluetoothController.setBluetoothListener(mListener); tvBTState.setText("Bluetooth state: " + Utils.transBtStateAsString(mBluetoothController.getBluetoothState())); }
mBluetoothController.setBluetoothListener(new BluetoothListener() { @Override public void onActionStateChanged(int preState, int state) {