Hey Guys,
I don't seem able to make menus work with Garmin Venu.
I rewrote my widget with Menu, Menu2 and CustomMenu but no luck; tried running both in the simulator and a physical watch. The same code runs fine with other devices (i.e. fenix843mm in the simulator).
Here is a tiny widget, just for you to try:
import Toybox.Application;import Toybox.Lang;import Toybox.WatchUi;
class MenuTestApp extends Application.AppBase {
function initialize() {AppBase.initialize();}
// onStart() is called on application start upfunction onStart(state as Dictionary?) as Void {}
// onStop() is called when your application is exitingfunction onStop(state as Dictionary?) as Void {}
// Return the initial view of your application herefunction getInitialView() as [Views] or [Views, InputDelegates] {return [ new MenuTestView(), new MenuTestDelegate() ];}
}
function getApp() as MenuTestApp {return Application.getApp() as MenuTestApp;}class MenuTestDelegate extends WatchUi.MenuInputDelegate {function initialize() {MenuInputDelegate.initialize();}
function onMenuItem(item) {if (item == :item_1) {System.println("Item 1");} else if (item == :item_2) {System.println("Item 2");}}}class MenuTestView extends Menu {
function initialize() {Menu.initialize();
setTitle("My Menu");
addItem("Item One", :item_1);addItem("Item Two", :item_2);}}
and when I try to execute this on Venu I get:
[...]
BUILD SUCCESSFUL
Error: Unexpected Type Error
Details: Failed to start CIQ Application
Stack:
Encountered an app crash.
What am I doing wrong?
I am on the Connect IQ 8.1.1, the Venu is on FW 3.3.1 so should support Menu (from memory, Menu is 1.0.0 onward).
Thank you!