/** Indicate that the connection was lost and notify the UI Activity. */ private void connectionLost() { if (DEBUG) { Log.i(TAG, "connectionLost()"); } // Send a failure message back to the Activity Message msg = mHandler.obtainMessage(MESSAGE_TOAST); Bundle bundle = new Bundle(); bundle.putString(TOAST, "Device connection was lost"); msg.setData(bundle); mHandler.sendMessage(msg); // Start the service over to restart listening mode // BluetoothService.this.start(); start(); }