I have a data field that stores persistent data so that in case of suspending or shutting down the device it is available when the activity continues.
I delete the data under two conditions:
function compute(info){
...
if (elapsedTimer == 0) {
Storage.clearValues();
}
...
function onTimerReset(){
Storage.clearValues();
}
But I have encountered a problem. if I finish an activity if I don't restart the device the stored variables are not emptied.
Any suggestion of where it is more correct to add the deletion?
Thanks in advance.