Hi,
I have implemented something like this. But it will show invalidateOptionsMenu error. Help me if anything wrong. I have test it in android version 3.0 and above.
index.xml
<Alloy> <Window id="win" fullscreen="true" onOpen="doOpen"> <Menu id="menu" platform="android"> <MenuItem id="menuItem" title="Item 1" icon="item1.png" onClick="doClick" showAsAction="Ti.Android.SHOW_AS_ACTION_IF_ROOM" /> </Menu> </Window> </Alloy>index.js
function doClick(e) { Ti.API.info("Menu item clicked: " + e.source.title); } function doOpen(e) { $.win.invalidateOptionsMenu(); }