{ "id": "61461", "key": "TIMOB-829", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [ { "id": "11239", "name": "Release 1.6.0 M06", "archived": true, "released": true, "releaseDate": "2011-01-24" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2011-04-17T01:54:22.000+0000", "created": "2011-04-15T02:37:20.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [ "android", "defect", "release-1.6.0" ], "versions": [], "issuelinks": [], "assignee": { "name": "jhaynie", "key": "jhaynie", "displayName": "Jeff Haynie", "active": false, "timeZone": "America/Los_Angeles" }, "updated": "2011-04-17T01:54:22.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "10202", "name": "Android", "description": "Android Platform" } ], "description": "{html}
The problem is that the Activity that creates the menu isn't\nalways the current activity that has access to the menu.
Click FAIL re-assigning to me instead of Jeff.
Reports of it's operation being intermittent as well even with\nsingle Windows.
This may no longer be valid.
This is eons old and the menu system has changed for the better\nsince then. I see no problem with menus in tabbed window contexts.\nMy test case app.js, win1.js and win2.js:
\napp.js:
\n\nTitanium.UI.setBackgroundColor('#000');\nvar tabGroup = Titanium.UI.createTabGroup();\nvar win1 = Titanium.UI.createWindow({ \n title:'Tab 1',\n backgroundColor:'#fff',\n url: 'win1.js'\n});\nvar tab1 = Titanium.UI.createTab({ \n icon:'KS_nav_views.png',\n title:'Tab 1',\n window:win1\n});\n\nvar win2 = Titanium.UI.createWindow({ \n title:'Tab 2',\n backgroundColor:'#fff',\n url: 'win2.js'\n});\nvar tab2 = Titanium.UI.createTab({ \n icon:'KS_nav_ui.png',\n title:'Tab 2',\n window:win2\n});\n\ntabGroup.addTab(tab1); \ntabGroup.addTab(tab2); \ntabGroup.open();
\n
\nwin1.js:
\n\nvar win = Ti.UI.currentWindow;\n\nvar activity = Ti.Android.currentActivity;\nactivity.onCreateOptionsMenu = function(e) {\n var m = e.menu.add({title: 'Win 1 Item 1'});\n m.addEventListener('click', function(){alert('Win 1 Item 1 click');});\n};\nwin.add(Ti.UI.createLabel({text: 'Press menu and you should see \"Win 1 Item 1\"'}));
\n
\nwin2.js:
\n\nvar win = Ti.UI.currentWindow;\n\nvar activity = Ti.Android.currentActivity;\nactivity.onCreateOptionsMenu = function(e) {\n var m = e.menu.add({title: 'Win 2 Item 1'});\n m.addEventListener('click', function(){alert('Win 2 Item 1 click');});\n};\nwin.add(Ti.UI.createLabel({text: 'Press menu and you should see \"Win 2 Item 1\"'}));
\n
Verified on G1/1.6 and Nexus One/2.2.1 using build #e1cb22a