https://forums.garmin.com/forum/deve...pleteexception
https://forums.garmin.com/forum/deve...on-va-hr/page2
I hope this time we manage to understand each other.
Here is a complete code to reproduce the problem. Just copy, paste, compile, upload and install on a real VAHR.
I'm using Toybox.System.exitTo(intent) to open another app I have (not a native app). It fails (hangs?) on the Vivoactive HR. Nothing happens on a first try, and then Toybox::System::PreviousOperationNotCompleteException occurs. It works perfectly in the sim (even on the VAHR sim) and on other devices.
The manifest id in the example (CE62BDE5-05EF-41D3-8872-7D3F901317CD) is from this app:
https://apps.garmin.com/en-US/apps/a...b-25d562155e44
It could be any app from the CIQ store. Whichever app you choose, you must have it installed on the real Vivoactive HR to see the error.
using Toybox.Application as App;
using Toybox.WatchUi as Ui;
using Toybox.System as Sys;
using Toybox.Graphics as Gfx;
var errorMsg = "";
class SystemExitToVAHRFailApp extends App.AppBase {
function initialize( ) {AppBase.initialize( );}
function onStart(state) { }
function onStop(state) { }
function getInitialView( ) {return [ new SystemExitToVAHRFailView( ), new SystemExitToVAHRFailDelegate( ) ];}
}
class SystemExitToVAHRFailView extends Ui.View {
function initialize( ) {View.initialize( ); }
function onLayout(dc) {}
function onShow( ) {}
function onHide( ) {}
function onUpdate(dc) {
View.onUpdate(dc);
dc.setColor(Gfx.COLOR_BLACK, Gfx.COLOR_BLACK);
dc.clear( );
dc.setColor(Gfx.COLOR_WHITE, Gfx.COLOR_TRANSPARENT);
dc.drawText(
dc.getWidth( ) / 2,
dc.getHeight( ) / 4,
Gfx.FONT_SMALL,
"Open the menu",
Gfx.TEXT_JUSTIFY_CENTER|Gfx.TEXT_JUSTIFY_VCENTER
);
dc.drawText(
dc.getWidth( ) / 2,
dc.getHeight( ) / 2,
Gfx.FONT_XTINY,
errorMsg,
Gfx.TEXT_JUSTIFY_CENTER|Gfx.TEXT_JUSTIFY_VCENTER
);
}
}
class SystemExitToVAHRFailDelegate extends Ui.BehaviorDelegate {
function initialize( ) {BehaviorDelegate.initialize( );}
function onMenu( ) {
var aMenu = new Ui.Menu( );
aMenu.setTitle("Test System.exitTo( )");
aMenu.addItem("Exit to a CIQ app", :menuOpenApp);
Ui.pushView(aMenu, new SystemExitToVAHRFailMenuDelegate( ), Ui.SLIDE_IMMEDIATE );
return true;
}
}
class SystemExitToVAHRFailMenuDelegate extends Ui.MenuInputDelegate {
function initialize( ) {
MenuInputDelegate.initialize();
}
function onMenuItem(item) {
if
(item == :menuOpenApp) {
try
{
Sys.exitTo(
new Sys.Intent(
"manifest-id://CE62BDE5-05EF-41D3-8872-7D3F901317CD",
{
"Param1" => [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29],
"Param2" => [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29]
}
)
);
}
catch (exception)
{
errorMsg = exception.getErrorMessage( );
Ui.requestUpdate( );
}
}
}
}