Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-6439] Android: Menu: Rhino/v8: Adding onCreateOptionsMenu after window creation does not work

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2012-01-04T10:51:48.000+0000
Affected Version/sRelease 1.8.0.1
Fix Version/sSprint 2011-48, Release 1.8.0.1
ComponentsAndroid
Labelsbranch-v8, module_android, qe-testadded
ReporterAllen Yeung
AssigneeAllen Yeung
Created2011-12-02T14:52:55.000+0000
Updated2014-06-19T12:43:54.000+0000

Description

Steps to reproduce: 1. Launch the app.js specified 2. Click on menu Expected Result: Menu appears with an "Add Task" option. (should say 'works' when invoked) Actual Result: Menu does not appear
var win = Ti.UI.createWindow({
	backgroundColor: '#fff',
	navBarHidden: false,
});


win.addEventListener('open', function(e) {
	win.activity.onCreateOptionsMenu = function(e) {
	    var menu = e.menu;
	    var menuItem = menu.add({ title: "Add Task" });
	    menuItem.setIcon("KS_nav_ui.png");
	    menuItem.addEventListener("click", function(e) {
	        alert('works');
	    });
	};
});

win.open();

Comments

  1. Dustin Hyde 2011-12-05

    Bug fixed. Verfied on: SDK: 1.8.0.1.v20111205011857 Studio: 1.0.7.201112041107 OS: OS X Lion Devices: all supported Android devices
  2. Dustin Hyde 2012-01-04

    Added label qe-testadded.

JSON Source