{ "id": "107786", "key": "AC-2220", "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": "5", "description": "All attempts at reproducing this issue failed, or not enough information was available to reproduce the issue. Reading the code produces no clues as to why this behavior would occur. If more information appears later, please reopen the issue.", "name": "Cannot Reproduce" }, "resolutiondate": "2014-01-19T08:07:27.000+0000", "created": "2013-01-14T08:23:09.000+0000", "labels": [ "actionbar", "android" ], "versions": [], "issuelinks": [], "assignee": { "name": "shossain", "key": "shossain", "displayName": "Shak Hossain", "active": false, "timeZone": "America/Los_Angeles" }, "updated": "2016-03-08T07:41:13.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": "When you open a heavyweight Window from a TabGroup's tab and set the new window's Activity's ActionBar's displayHomeAsUp property to true, the Activity.onCreateOptionsMenu() callback is never called, therefore the menu items are not created.\r\n\r\nCode snippet:\r\n\r\n{code}\r\nvar win = Ti.UI.createWindow({\r\n title: 'New win',\r\n backgroundColor: 'white'\r\n});\r\nvar activity = win.getActivity();\r\nwin.addEventListener('open', function() {\r\n activity.actionBar.setDisplayHomeAsUp(true);\r\n});\r\nactivity.onCreateOptionsMenu = function(e) {\r\n var menu = e.menu;\r\n menu.add({\r\n title: 'Your action',\r\n showAsAction: Ti.Android.SHOW_AS_ACTION_ALWAYS\r\n });\r\n};\r\n\r\nyourTab.open(win);\r\n{code}\r\n\r\nIf we remove the line that sets displayHomeAsUp to true, the menuItem is correctly drawn.\r\n", "attachment": [], "flagged": false, "summary": "Android: displayHomeAsUp and onCreateOptionsMenu together are broken", "creator": { "name": "tkeunebr", "key": "tkeunebr", "displayName": "Thomas Keunebroek", "active": true, "timeZone": "Europe/Berlin" }, "subtasks": [], "reporter": { "name": "tkeunebr", "key": "tkeunebr", "displayName": "Thomas Keunebroek", "active": true, "timeZone": "Europe/Berlin" }, "environment": "TiSDK v3.0\r\nAndroid 4.2", "comment": { "comments": [ { "id": "237338", "author": { "name": "nsharma", "key": "nsharma", "displayName": "Nikhil Sharma", "active": true, "timeZone": "America/Los_Angeles" }, "body": "The test case that you've provided contains errors. Could you please provide a valid test case?", "updateAuthor": { "name": "nsharma", "key": "nsharma", "displayName": "Nikhil Sharma", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-02-06T01:01:25.000+0000", "updated": "2013-02-06T01:01:25.000+0000" }, { "id": "237413", "author": { "name": "tkeunebr", "key": "tkeunebr", "displayName": "Thomas Keunebroek", "active": true, "timeZone": "Europe/Berlin" }, "body": "Here you go:\n\napp.js\n{code}\n(function() {\n\n var tabGroup = Ti.UI.createTabGroup();\n\n\tvar win1 = Ti.UI.createWindow({\n title: 'win1'\n });\n\n var btn = Ti.UI.createButton({\n title: 'open win2',\n height: 84,\n width: 200,\n top: 20\n });\n\n win1.add(btn);\n\n var win2 = Ti.UI.createWindow({\n title: 'win2'\n });\n\n btn.addEventListener('click', function() {\n tab.open(win2);\n });\n\n win2.addEventListener('open', function() {\n this.getActivity().actionBar.setDisplayHomeAsUp(true);\n });\n\n win2.getActivity().onCreateOptionsMenu = function(e) {\n var menu = e.menu;\n menu.add({\n title: 'My action',\n showAsAction: Ti.Android.SHOW_AS_ACTION_ALWAYS\n });\n };\n\n var tab = Ti.UI.createTab({\n title: 'tab',\n window: win1\n });\n\n tabGroup.addTab(tab);\n\n tabGroup.open();\n\n})();\n{code}\n\ntiapp.xml\n{code}\n\n\n com.tab.test\n TabTest\n 1.0\n shopmium\n http://\n not specified\n 2013 by shopmium\n appicon.png\n false\n false\n default\n false\n false\n false\n true\n e962583e-41b2-4280-b05a-dfa612e015f2\n system\n \n \n Ti.UI.PORTRAIT\n \n \n Ti.UI.PORTRAIT\n Ti.UI.UPSIDE_PORTRAIT\n Ti.UI.LANDSCAPE_LEFT\n Ti.UI.LANDSCAPE_RIGHT\n \n \n\t\n\t17\n\t\n\t\t\n\t\n\t\t\n\t\n\t\t\n\t\n\t\t\t\n\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\t\t\n\t\n\t\t\t\n\t\n\t\t\n\t\n \n \n false\n true\n false\n false\n false\n \n 3.0.0.GA\n\n{code}\n\nIf you run the above code snippet, you'll see that you don't have any options menu created. However, if you don't set the up affordance by commenting the line {code}this.getActivity().actionBar.setDisplayHomeAsUp(true){code}, you will get your action. Those two features should be working at the same time without any problem.\n\nI hope it's clearer this way.\n\nRegards,", "updateAuthor": { "name": "tkeunebr", "key": "tkeunebr", "displayName": "Thomas Keunebroek", "active": true, "timeZone": "Europe/Berlin" }, "created": "2013-02-06T10:18:12.000+0000", "updated": "2013-02-06T10:18:12.000+0000" }, { "id": "283057", "author": { "name": "mrahman", "key": "mrahman", "displayName": "Mostafizur Rahman", "active": true, "timeZone": "Asia/Dhaka" }, "body": "Hello,\r\n\r\nWe tested this issue with your test code using the latest 3.1.3 GA. We can’t reproduce this issue in Ti SDK 3.1.3GA. It is most likely fixed. Please test your issue using the latest release and let us know your feedback. \r\n\r\nh5. Testing Environment: \r\n\r\nOS: MAC OS X 10.8.5\r\nTi SDK: 3.0.0/3.1.3GA \r\nAndroid SDK 4.2.2\r\n\r\nThanks \r\n", "updateAuthor": { "name": "shossain", "key": "shossain", "displayName": "Shak Hossain", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2013-12-07T16:44:25.000+0000", "updated": "2013-12-07T18:50:51.000+0000" } ], "maxResults": 3, "total": 3, "startAt": 0 } } }