{ "id": "104055", "key": "TIMOB-11602", "fields": { "issuetype": { "id": "2", "description": "A new feature of the product, which has yet to be developed.", "name": "New Feature", "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": "13505", "description": "Release 3.0.0", "name": "Release 3.0.0", "archived": true, "released": true, "releaseDate": "2012-12-14" }, { "id": "14162", "description": "Release 3.1.0", "name": "Release 3.1.0", "archived": true, "released": true, "releaseDate": "2013-04-16" }, { "id": "14619", "description": "2012 Sprint 23 Core", "name": "2012 Sprint 23 Core", "archived": true, "released": true, "releaseDate": "2012-11-19" }, { "id": "14623", "description": "2012 Sprint 23 JS", "name": "2012 Sprint 23", "archived": true, "released": true, "releaseDate": "2012-11-19" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2014-08-15T21:13:54.000+0000", "created": "2012-10-29T21:24:17.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "3.0.0beta2", "module_android", "qe-automation", "qe-port", "triage" ], "versions": [ { "id": "13505", "description": "Release 3.0.0", "name": "Release 3.0.0", "archived": true, "released": true, "releaseDate": "2012-12-14" } ], "issuelinks": [], "assignee": { "name": "ayeung", "key": "ayeung", "displayName": "Allen Yeung", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2014-08-15T21:13:54.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": "As described in http://developer.android.com/guide/topics/ui/menus.html#ChangingTheMenu, to change menu items (action items) in 3.0 and above, we'd need to expose the invalidateOptionsMenu method. ", "attachment": [], "flagged": false, "summary": "Android: Expose activity.invalidateOptionsMenu to allow changing action items in Android 3.0 and above", "creator": { "name": "aevans", "key": "aevans", "displayName": "Arthur Evans", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "aevans", "key": "aevans", "displayName": "Arthur Evans", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "225764", "author": { "name": "ayeung", "key": "ayeung", "displayName": "Allen Yeung", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Test Steps:\n1. Add the following entry into your Tiapp.xml:\n\n{code}\n \n \n \n \n \n{code}\n\n2. Run the code snippet:\n\n{code}\nvar win = Ti.UI.createWindow({\n\tfullscreen : true\n});\nvar LOGIN = 1, LOGOUT = 2;\nvar loggedIn = false;\n\nvar activity = win.activity;\n\nactivity.onCreateOptionsMenu = function(e) {\n\tvar menu = e.menu;\n\tvar login = menu.add({\n\t\ttitle : \"Login\",\n\t\titemId : LOGIN\n\t});\n\tlogin.setIcon(\"login.png\");\n\tlogin.addEventListener(\"click\", function(e) {\n\t\tloggedIn = true;\n\t\twin.activity.invalidateOptionsMenu();\n\t});\n\tlogin.showAsAction = Ti.Android.SHOW_AS_ACTION_ALWAYS;\n\tvar logout = menu.add({\n\t\ttitle : \"Logout\",\n\t\titemId : LOGOUT\n\t});\n\tlogout.setIcon(\"logout.png\");\n\n\tlogout.addEventListener(\"click\", function(e) {\n\t\tloggedIn = false;\n\t\twin.activity.invalidateOptionsMenu();\n\t}); \n\n\tlogout.showAsAction = Ti.Android.SHOW_AS_ACTION_ALWAYS;\n};\n\nactivity.onPrepareOptionsMenu = function(e) {\n\tvar menu = e.menu;\n\tmenu.findItem(LOGIN).setVisible(!loggedIn);\n\tmenu.findItem(LOGOUT).setVisible(loggedIn);\n};\n\nwin.addEventListener('click', function(){\n\twin.activity.openOptionsMenu();\n});\n\nwin.open(); \n{code}\n\n3. Click the login button in the action bar and it should change to logout\n\nThis should be run on a 2.3 and a 3.0+ devices. When testing on a 2.3 device also click on the window and make sure that the menu bar opens.\n", "updateAuthor": { "name": "ayeung", "key": "ayeung", "displayName": "Allen Yeung", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-11-01T01:04:44.000+0000", "updated": "2012-11-01T01:04:44.000+0000" }, { "id": "227038", "author": { "name": "pwang", "key": "pwang", "displayName": "Ping Wang", "active": true, "timeZone": "America/Los_Angeles" }, "body": "PR: https://github.com/appcelerator/titanium_mobile/pull/3369", "updateAuthor": { "name": "pwang", "key": "pwang", "displayName": "Ping Wang", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-11-12T19:35:14.000+0000", "updated": "2012-11-12T19:35:14.000+0000" }, { "id": "227106", "author": { "name": "ayeung", "key": "ayeung", "displayName": "Allen Yeung", "active": true, "timeZone": "America/Los_Angeles" }, "body": "3.X PR: https://github.com/appcelerator/titanium_mobile/pull/3414", "updateAuthor": { "name": "ayeung", "key": "ayeung", "displayName": "Allen Yeung", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-11-13T01:15:31.000+0000", "updated": "2012-11-13T01:15:31.000+0000" }, { "id": "227173", "author": { "name": "tsmolich", "key": "tsmolich", "displayName": "Tamila Smolich", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Closing as fixed. Expected behavior is shown.\r\nTested and verified on:\r\nTitanium Studio, build: 3.0.0.201211121907\r\nTitanium SDK, builds: 3.0.0.v20121113111657; 3.1.0.v20121112192600\r\nDevice: Samsung Galaxy SIII (4.0.4)", "updateAuthor": { "name": "tsmolich", "key": "tsmolich", "displayName": "Tamila Smolich", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-11-13T20:06:18.000+0000", "updated": "2012-11-13T20:06:18.000+0000" }, { "id": "227721", "author": { "name": "aevans", "key": "aevans", "displayName": "Arthur Evans", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Reopening to add label.", "updateAuthor": { "name": "aevans", "key": "aevans", "displayName": "Arthur Evans", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-11-16T19:22:11.000+0000", "updated": "2012-11-16T19:22:11.000+0000" } ], "maxResults": 5, "total": 5, "startAt": 0 } } }