Hello,
I would like to store a value after installatin the Watchface, FirstStart or initialize() or onStart() and then decrease it when onUpdate() on my Watchface.
This works works, but when I change to another widget (up/down on my Fenix5) and go back, the value goes to its startValue (=15).
How do I have to do this?
I tried with settings and with storage, without success!
Thanks
function initialize() {
AppBase.initialize();
Storage.setValue("myCounter", 15);
}
function onUpdate(dc) {
var myCounter= Storage.getValue("myCounter");
System.println("myCounter:" + myCounter.toString());
Storage.setValue("myCounter", myCounter-1);
System.println("myCounter:" + myCounter.toString());
???????...