always remember Set the menu on the current heavyweight window.
To create a heavyweight window, specify one or more of
- fullscreen,
- navBarHidden,
- modal
otherwise you can use you app.js file this is working.... with specify this property.
var menu = Titanium.UI.Android.OptionMenu.createMenu();
var item1 = Titanium.UI.Android.OptionMenu.createMenuItem({
title : 'Item 1',
icon : '/images/item1.png'
});
item1.addEventListener('click', function(){
Ti.UI.createAlertDialog({ title : 'You clicked Item 1'}).show();
});
var item2 = Titanium.UI.Android.OptionMenu.createMenuItem({
title : 'Refresh',
icon : '/images/refresh.png'
});
item2.addEventListener('click', function(){
Ti.UI.createAlertDialog({ title : 'You clicked Refresh'}).show();
});
menu.add(item1);
menu.add(item2);
// Set the menu on the current heavyweight window. A heavyweight window maps to an Android
// Activity. To create a heavyweight window, specify one or more of [**fullscreen**,**navBarHidden**,**modal**] to createWindow.
Titanium.UI.Android.OptionMenu.setMenu(menu);