Acknowledged
CIQQA-3719

Action Menu does not work with touch/mouse in the simulator - app crash

If you use an action menu using the device buttons everything seems to work fine. But if you use touch, i.e. click on the menu itself in the simulator with the mouse, the delegate is called, but the action menu is not popped and stays displayed.

This ultimately results in an app crash when you do use the buttons in an attempt to get off the menu:

selected 1

Error: Unexpected Type Error
Stack: 

Encountered app crash.

Thankfully, it all seems to work correctly on a real device, but means it cannot be tested at all on a touch device like the venu 2 or vivoactive 6.

This is broken in SDK 7.1.0 through to 8.4.0. It last worked in 6.2.4

Parents
  • I am seeing the same crash as in the OP, regardless of how I interact with the menu:

    - use mouse to click on action menu item itself (therefore simulating a touch on a physical device)

    - use mouse to click on simulated watch button (START or BACK), thus simulating device keypress

    - use keyboard to simulate device keypress (e.g. ENTER to simulate KEY_ENTER / START)

    To see the crash in the OP, all I have to do is take any of the above actions twice. The first action is supposed to pop the menu, but it doesn't. (At least the menu stays on the screen.) The second action causes the crash.

    Here's my code:

        // place this function in the main view of a device app generated via Monkey C: New Project
        function onShow() as Void {
            var menu = new ActionMenu(null);
            menu.addItem(new ActionMenuItem({:label => "foo"}, null));
            WatchUi.showActionMenu(menu, new ActionMenuDelegate());
        }

    The action menu is correctly displayed when I run my app, but any actions I take to try to exit the menu (as described above) seem to lead to a crash.
    No, I didn't test with a custom implementation of ActionMenuDelegate (yet). The docs for showActionMenu claim:

    > An action menu will dismiss it self on either user selecting a menu item or pressing back button.

    Even if it's not correct to provide an unmodified ActionMenuDelegate, I don't think the app should belatedly crash because of that. (However, I don't see any reason that passing an unmodified ActionMenuDelegate should be incorrect.)

    Recreation environments:

    fr955, SDK 8.3.0 / 8.4.0, Windows

    Output (8.3.0)

    Error: Unexpected Type Error
    Stack: 
    
    Encountered app crash.

    Output (8.4.0)

    Error: Null Reference Error
    Details: Failed invoking <symbol>
    Stack: 
    
    Encountered app crash.

Comment
  • I am seeing the same crash as in the OP, regardless of how I interact with the menu:

    - use mouse to click on action menu item itself (therefore simulating a touch on a physical device)

    - use mouse to click on simulated watch button (START or BACK), thus simulating device keypress

    - use keyboard to simulate device keypress (e.g. ENTER to simulate KEY_ENTER / START)

    To see the crash in the OP, all I have to do is take any of the above actions twice. The first action is supposed to pop the menu, but it doesn't. (At least the menu stays on the screen.) The second action causes the crash.

    Here's my code:

        // place this function in the main view of a device app generated via Monkey C: New Project
        function onShow() as Void {
            var menu = new ActionMenu(null);
            menu.addItem(new ActionMenuItem({:label => "foo"}, null));
            WatchUi.showActionMenu(menu, new ActionMenuDelegate());
        }

    The action menu is correctly displayed when I run my app, but any actions I take to try to exit the menu (as described above) seem to lead to a crash.
    No, I didn't test with a custom implementation of ActionMenuDelegate (yet). The docs for showActionMenu claim:

    > An action menu will dismiss it self on either user selecting a menu item or pressing back button.

    Even if it's not correct to provide an unmodified ActionMenuDelegate, I don't think the app should belatedly crash because of that. (However, I don't see any reason that passing an unmodified ActionMenuDelegate should be incorrect.)

    Recreation environments:

    fr955, SDK 8.3.0 / 8.4.0, Windows

    Output (8.3.0)

    Error: Unexpected Type Error
    Stack: 
    
    Encountered app crash.

    Output (8.4.0)

    Error: Null Reference Error
    Details: Failed invoking <symbol>
    Stack: 
    
    Encountered app crash.

Children