Timer never stops
I'm having so many problems with the timer, now the problem is that never stops, it keeps updating even when I close the temperature activity,
)).continueWithTask(task -> {
streamRoute = task.getResult();
if(task.isFaulted())
Log.e("boardReady", "*****************************1");
return timerModule.scheduleAsync(TEMP_SAMPLE_PERIOD, false, tempsensor::read);
}).continueWithTask(task -> {
if(task.isFaulted()) {
Log.e("boardReady", "*****************************2");
Log.e("boardReady", task.getError().getMessage());
}
scheduledTask = task.getResult();
scheduledTask.start();
return null;
});
}
protected void clean() {
scheduledTask.remove();
}
I want that when the user close the activity it stops updating and i already put the scheduledtask remove
This discussion has been closed.
Comments
clean
function called?