Hi all!
I am working on a watch face. After I receive information through WebRequest, depending on the response, I save the property using the setProperty method.
function onBackgroundData(data) { Sys.println(data); for (var i = 0; i < data.size(); i++){ if (data[i] != null){ if (data[i].hashCode() == "ERROR".hashCode()){ App.getApp().setProperty("testVar", "notOkay"); } else if (data[i].hashCode() == "DONE".hashCode()){ App.getApp().setProperty("testVar", "okay"); } } } Ui.requestUpdate(); }
This is what the properties.xml document looks like
<properties> <property id="testVar" type="string"></property> </properties>
While the dial is running, everything works. The string is saved and works correctly. However, if I exit the application and start it again, the data disappears.
getProperty returns what is specified by default in properties.xml
I’ve been racking my brains for three days looking for a solution to this problem. How do I save a value so that it works even after restarting the application?