private void stopConnectionTask() { if (connectionTask != null) { connectionTask.cancel(true); connectionTask = null; } }
private void startConnectionTask(RemoteDevice remoteDevice) { stopConnectionTask(); connectionTask = new ConnectionTask(this); connectionTask.execute(remoteDevice); }