On the file from App I Have:
(:background)
class watchapp1App extends Application.AppBase {
hidden var scanner;
hidden var model;
private var _view;
function initialize() {
AppBase.initialize();
model = new ResultsModel(); <---- this is the line that the error present, no issue before try to join a background on this project
scanner = new Scanner(model);
function getInitialView() {
//register for temporal events if they are supported
if(Toybox.System has :ServiceDelegate) {
canDoBG=true;
Background.registerForTemporalEvent(new Time.Duration(5 * 60));
System.println("Registo Efectuado BackGround - TRUE");
} else {
System.println("****background not available on this device****");
}
_view = new watchapp1View(model);
return [ _view, new KeyHandler(scanner) ];
}
function getServiceDelegate() as ServiceDelegate{
return new BackGServiceDelegate();
}
On my Background file:
(:background)
class BackGServiceDelegate extends Toybox.System.ServiceDelegate {
function initialize() {
Sys.ServiceDelegate.initialize();
//inBackground=true; //trick for onExit()
Sys.println("inBackGround: TRUE");
}
function onTemporalEvent() {
System.println("TTTTEEEEMMMPPPOOORRRAAALLLLLLL");
Background.exit(null);
}
}
Im using the CIQ, i receive the error message every 5 minutes ( but no movement on onTemporalEvent())
With the same code I manage to start a new App and runs just fine (the temporal event).
I'm noob on this, can anyone help me ? thanks in advance