I have an app that I am trying to pass back a VAR to the View. It works in the SIM, but not on my Device. Is this a known issue?
Ronnie
I have an app that I am trying to pass back a VAR to the View. It works in the SIM, but not on my Device. Is this a known issue?
Ronnie
Need to see some code. How are you trying to pass something back?
class BasicSettingsMenuDelegate extends WatchUi.Menu2InputDelegate {
function initialize() {
Menu2InputDelegate.initialize();
}
function onSelect(menuItem) {
Storage.setValue(menuItem.getId(), menuItem.isEnabled());
if ( menuItem.getId() == 1 ) {
clockType = menuItem.isEnabled();
putSettings = true;
debugValue = "A";
}
if ( menuItem.getId() == 2 ) {
digiTimeAnalog = menuItem.isEnabled();
putSettings = true;
debugValue = "B";
}
//return(debugValue);
}
}
using Toybox.WatchUi as Ui;
using Toybox.Graphics as Gfx;
using Toybox.System as Sys;
using Toybox.Lang as Lang;
using Toybox.Application as App;
using Toybox.ActivityMonitor as ActivityMonitor;
using Toybox.Timer as Timer;
var getSettings;
var clockType;
var putSettings;
var digiTimeAnalog;
var debugValue;
enum {
SCREEN_SHAPE_CIRC = 0x000001,
SCREEN_SHAPE_SEMICIRC = 0x000002,
SCREEN_SHAPE_RECT = 0x000003
}
class BasicView extends Ui.WatchFace {
I'm still confused. Are you trying do do on device settings for a watch face? In that case you want to save things in either Applications.Storage or Application.Properties (probably Storage if this is on device only), and then have the WF read Storage when it starts.
I figured it out - Was trying to use both -
The end result is when the Menu2 ends a completely new instance of WF starts and all variables are initialized. So the only way to send something back is through storage. You can however send something forward to the Menu2 as a public VAR.