{ "id": "86567", "key": "AC-2806", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "12217", "key": "AC", "name": "Appcelerator - INBOX", "projectCategory": { "id": "10000", "description": "", "name": "Customer Service" } }, "resolution": { "id": "7", "description": "", "name": "Invalid" }, "resolutiondate": "2012-03-26T12:09:26.000+0000", "created": "2012-02-16T07:52:00.000+0000", "labels": [ "1.8.2", "2.0.0", "activity", "android", "menu" ], "versions": [], "issuelinks": [], "assignee": { "name": "mpmiranda", "key": "mpmiranda", "displayName": "Mauro Parra-Miranda", "active": true, "timeZone": "America/Mexico_City" }, "updated": "2016-03-08T07:47:43.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": "14548", "name": "Titanium SDK & CLI", "description": "Please enter tickets related to the MobileSDK here." } ], "description": "If you create a window and do not set the navBarHidden property on it, then the activity property will not exist on the window so you cannot do things like create menus. The code below will error due to win.activity not existing. Uncomment the navBarHidden property and then rerun and the menu will successfully be created.\r\n\r\n{code}\r\nvar win = Ti.UI.createWindow({ \r\n\tbackgroundColor: \"#fff\" \r\n\t//navBarHidden: true\r\n});\r\n\r\nwin.open();\r\n\r\nTi.API.info(win);\r\nTi.API.info(win.activity);\r\nvar activity = win.activity;\r\n \r\nactivity.onCreateOptionsMenu = function(e){\r\n var menu = e.menu;\r\n var menuItem = menu.add({ title: \"Item 1\" });\r\n menuItem.addEventListener(\"click\", function(e) {\r\n Ti.API.debug(\"I was clicked\");\r\n });\r\n};\r\n{code}", "attachment": [], "flagged": false, "summary": "Window.activity property does not exist if navBarHidden is not set", "creator": { "name": "jtoth", "key": "jtoth", "displayName": "Justin Toth", "active": true, "timeZone": "America/New_York" }, "subtasks": [], "reporter": { "name": "jtoth", "key": "jtoth", "displayName": "Justin Toth", "active": true, "timeZone": "America/New_York" }, "environment": "Ti 1.8.2.v20120215170143, 2.0.0.v20120215111634\r\nAndroid 2.2, 3.2", "comment": { "comments": [ { "id": "183679", "author": { "name": "jtoth", "key": "jtoth", "displayName": "Justin Toth", "active": true, "timeZone": "America/New_York" }, "body": "This can be closed as expected behavior. A window is only an activity in itself if it's heavyweight, which occurs if navBarHidden is set.", "updateAuthor": { "name": "jtoth", "key": "jtoth", "displayName": "Justin Toth", "active": true, "timeZone": "America/New_York" }, "created": "2012-02-17T14:19:49.000+0000", "updated": "2012-02-17T14:19:49.000+0000" }, { "id": "280985", "author": { "name": "mpmiranda", "key": "mpmiranda", "displayName": "Mauro Parra-Miranda", "active": true, "timeZone": "America/Mexico_City" }, "body": "Invalid issue. ", "updateAuthor": { "name": "mpmiranda", "key": "mpmiranda", "displayName": "Mauro Parra-Miranda", "active": true, "timeZone": "America/Mexico_City" }, "created": "2013-11-24T22:18:31.000+0000", "updated": "2013-11-24T22:18:31.000+0000" } ], "maxResults": 2, "total": 2, "startAt": 0 } } }