I'm using Toybox.System.exitTo(intent) to open another app I have (not to a native app). It fails (hangs?) on the Vivoactive HR. Nothing happens on a first try, and then Toybox::System::PreviousOperationNotCompleteException . It works perfectly in the sim and on a real Fenix 5S. I couldn't test with more devices, but I believe that the issue is only with the Vivoactive HR (SW 4.00, Connect IQ 2.3.1).
Remaks about the code below:
- Replace @ by ( and * by ) . Sounds crazy, but I needed this trick to avoid the forum bug (it wouldn't let me post otherwise).
- I chose not to disclose my target app ID in the code below. Of course, the target app should be installed on the device. So you'll need to create another app in order to test.
- The second argument of the intent is a dictionary with two arrays containing 80 float values each. Not too big, I think...
- Garmin, if you can't reproduce the issue with the code below, let me know and I'll send my "production" code.
Code to reproduce the issue
using Toybox.WatchUi as Ui;
using Toybox.System as Sys;
using Toybox.Graphics as Gfx;
var errorMsg = "";
class AppChooserView extends Ui.View {
function initialize@* {
View.initialize@*;
}
function onLayout@dc* {
}
function onUpdate@dc* {
View.onUpdate@dc*;
[email protected]_BLACK, Gfx.COLOR_BLACK*;
dc.clear@*;
[email protected]_WHITE, Gfx.COLOR_TRANSPARENT*;
[email protected]@*/2, dc.getHeight@*/2, Gfx.FONT_XTINY , errorMsg, Gfx.TEXT_JUSTIFY_CENTER|Gfx.TEXT_JUSTIFY_VCENTER*;
}
}
class AppChooserDelegate extends Ui.BehaviorDelegate {
function initialize@* {
BehaviorDelegate.initialize@*;
}
function onKey@ evt *
{
var key = evt.getKey@*;
if@ key == KEY_ENTER *
{
try
{
var field1 = [0.0];
var field2 = [0.0];
for @var i = 1; i < 80; i++*
{
[email protected]*;
[email protected]*;
}
Sys.exitTo@new Sys.Intent@"manifest-id://00000000-0000-0000-0000-000000000000", {"field1" => field1, "field2" => field1}**;
}
catch @ex*
{
errorMsg = ex.getErrorMessage@*;
Ui.requestUpdate@*;
}
return true;
}
return false;
}
function onBack@*
{
if @errorMsg.length@* > 0*
{
errorMsg = "";
return true;
}
return false;
}
}