Hello again,
Here is another error
I'm trying to instantiate a class but it says that :
Error: Illegal Access (Out of Bounds) Details: Failed invoking <symbol> Stack: - initialize() .../jsonBackground.mc:14 0x10000023
the jsonBackground.mc file:
using Toybox.Background as Bg; using Toybox.System as Sys; // The Service Delegate is the main entry point for background processes // our onTemporalEvent() method will get run each time our periodic event // is triggered by the system. (:background) class JsonBackground extends Toybox.System.ServiceDelegate { //hidden var _transaction=null; function initialize() { Sys.ServiceDelegate.initialize(); var ltd=new LoginTransactionDelegate(); //_transaction = new LoginTransaction(ltd); } function onTemporalEvent() { System.print("onTemporalEvent"); Bg.exit(1); } }
the LoginTransactionDelegate class:
using Toybox.Background as Bg; using Toybox.System as Sys; using Toybox.Communications as Comm; using Toybox.WatchUi as Ui; // The Service Delegate is the main entry point for background processes // our onTemporalEvent() method will get run each time our periodic event // is triggered by the system. // This is a TransactionDelegate for handling the login class LoginTransactionDelegate extends TransactionDelegate{ // Constructor function initialize() { TransactionDelegate.initialize(); } function handleResponse(data) { System.println("OK "+data); } function handleError(code) { var msg = "err"; msg += code; System.println(msg); } }
Thanks in advance