Hi I have an function to switch to another view:
WatchUi.switchToView(new weatherResultView(data), WatchUi.MenuInputDelegate, WatchUi.SLIDE_IMMEDIATE);
Inside weatherResultView
view I need function to handle click on buttons. In the above code I send WatchUi.MenuInputDelegate
it's delegate to handle click buttons, but I don't know How I can write function to handle click on button.
In weatherResultView
inside initialize
function I added: MenuInputDelegate.initialize();
And function to handle click on button:
function onMenuItem(item as Symbol) as Void {
switch ( item ) {
case :item_1: {
var pos = new weatherPosition();
pos.findPosition();
break;
}
case :item_2: {
System.println("item 2");
break;
}
default:
break;
}
}
But this not working.