@Override protected void onResume() { super.onResume(); // Performing this check in onResume() covers the case in which BT was // not enabled during onStart(), so we were paused to enable it... // onResume() will be called when ACTION_REQUEST_ENABLE activity returns. if (mCommandService != null) { if (mCommandService.getState() == BluetoothCommandService.STATE_NONE) { mCommandService.start(); } } }