Acknowledged
CIQQA-3244

Device Crashes When Deleting Item from Active CustomMenu

Deleting a menu item from a CustomMenu that is currently displayed causes the app to crash on the Epix 2 Pro 47mm.

The call to CustomMenu.deleteItem successfully removes the item, but on the next UI update, the app crashes with the following error:

Error: Array Out Of Bounds Error
Time: 2025-05-19T19:36:09Z
Part-Number: 006-B4313-00
Firmware-Version: 20.22
Language-Code: eng
ConnectIQ-Version: 5.1.1
Store-Id: 8a6b62f1-5450-4912-8799-2eeaf9779d97
Store-Version: 44
Filename: F56A2548
Appname: openHAB
Stack:

The issue also affects addItem, though less severely. When a new item is added, it does not appear during the next UI update.

In the simulator, both addItem and deleteItem work as expected—menu changes are reflected correctly on the next UI refresh.

Project: ohg on GitHub
Relevant CustomMenu implementation: BasePageMenu.mc

Parents
  • Hi Richard,

    Did you try it on a real device, and with a menu that is currently being displayed? This issue only occurs on real devices and specifically when deleting an item from a menu that is actively shown.

    I don’t think it’s related to my itemCount for two reasons:

    1. The ArrayOutOfBounds exception doesn't happen in my code, but in the API code during UI refresh. Since the API isn't aware of my custom itemCount, a bug in my code shouldn't cause that.

    2. When I apply the workaround mentioned in my comment below, everything works as expected. This workaround doesn’t affect my own itemCount logic.

    To me, this suggests that something in the onShow() method of CustomMenu / Menu2 is necessary to fully process item count changes.

Comment
  • Hi Richard,

    Did you try it on a real device, and with a menu that is currently being displayed? This issue only occurs on real devices and specifically when deleting an item from a menu that is actively shown.

    I don’t think it’s related to my itemCount for two reasons:

    1. The ArrayOutOfBounds exception doesn't happen in my code, but in the API code during UI refresh. Since the API isn't aware of my custom itemCount, a bug in my code shouldn't cause that.

    2. When I apply the workaround mentioned in my comment below, everything works as expected. This workaround doesn’t affect my own itemCount logic.

    To me, this suggests that something in the onShow() method of CustomMenu / Menu2 is necessary to fully process item count changes.

Children