how to change the displayed layout after clicking the menu item2 ?
I want to change the view from MainLayout to MainLayout2.
menudelegate.mc
import Toybox.Lang; import Toybox.System; import Toybox.WatchUi; class test2MenuDelegate extends WatchUi.MenuInputDelegate { function initialize() { MenuInputDelegate.initialize(); } function onMenuItem(item as Symbol) as Void { if (item == :item_1) { System.println("item 1"); } else if (item == :item_2) { System.println("item 2"); } } }
layout.xml
<resources> <layout id="MainLayout"> <label x="center" y="5" text="@Strings.prompt" color="Graphics.COLOR_WHITE" justification="Graphics.TEXT_JUSTIFY_CENTER" /> <bitmap id="id_monkey" x="center" y="30" filename="../drawables/1.svg" /> </layout> <layout id="MainLayout2"> <label x="center" y="5" text="@Strings.prompt" color="Graphics.COLOR_WHITE" justification="Graphics.TEXT_JUSTIFY_CENTER" /> </layout> </resources>