hi mate,
It is for a Compass widget
so here is the code for the Glance view:
(:glance) class SHNGlanceView extends Ui.GlanceView { function initialize() { GlanceView.initialize(); Sensor.enableSensorEvents( method(:onSnsrG) ); } function onSnsrG (info){ Ui.requestUpdate(); } function onHide(){ Sensor.setEnabledSensors([]); } function onUpdate(dc) { blablabla } }
so here no problem
and my main view
class SHNCompassView extends Ui.View { function initialize() { Sensor.enableSensorEvents( method(:onSnsr) ); } function onSnsr (info){ Ui.requestUpdate(); } blablabla }
If I open the widget with a non Glance device or Glance view off, no problem also,
but if the Galnce view is on, the main view does not update as expected.
Am I missing something?
should i remove
function onHide(){
Sensor.setEnabledSensors([]);
}
from the GlanceView?
have a great day