local widget = require( “widget” )
– Handle press events for the checkbox
local function onSwitchPress( event )
local switch = event.target
print( “Switch with ID '”…switch.id…"’ is on: "…tostring(switch.isOn) )
end
– Create the widget
local onOffSwitch = widget.newSwitch
{
left = 250,
top = 200,
style = “onOff”,
id = “onOffSwitch”,
onPress = onSwitchPress
}
so i put this in “option.lua” . i turn the switch to “ON”
i move to “menu.lua” and use 'storyboard.removeScene(“option”) to clear the previous scene
when i go back to “option.lua”, it goes back to “OFF” state (that’s because of removeScene()) … what do i do to keep it in it’s “ON” state( i turned it ON the last time) ?