/** * Creates and starts the a thread for communication via bluetooth to the NXT robot. * * @param mac_address The MAC address of the NXT robot. */ private void startBTCommunicator(String mac_address) { connected = false; connectingProgressDialog = ProgressDialog.show( this, "", getResources().getString(R.string.connecting_please_wait), true); if (myBTCommunicator != null) { try { myBTCommunicator.destroyNXTconnection(); } catch (IOException e) { } } createBTCommunicator(); myBTCommunicator.setMACAddress(mac_address); myBTCommunicator.start(); updateButtonsAndMenu(); }