{ "id": "104300", "key": "TIMOB-11642", "fields": { "issuetype": { "id": "5", "description": "The sub-task of the issue", "name": "Sub-task", "subtask": true }, "parent": { "id": "104048", "key": "TIMOB-11601", "fields": { "summary": "Android: Expose ActionBar methods", "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" } }, "priority": { "name": "High", "id": "2" }, "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": [], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2012-11-13T22:05:31.000+0000", "created": "2012-11-02T00:31:41.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "actionbar", "qe-testadded" ], "versions": [], "issuelinks": [ { "id": "22927", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "inwardIssue": { "id": "105220", "key": "TIMOB-11824", "fields": { "summary": "Android: Opening alert() from action bar \"home\" icon click handler causes crash", "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" } }, "priority": { "name": "High", "id": "2" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": { "name": "ayeung", "key": "ayeung", "displayName": "Allen Yeung", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2014-06-19T12:42:51.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": "We need to be able to add click event listeners to the app icon button inside the action bar. According the action docs, we would need to handle it in the onOptionsItemSelected() method.\r\n\r\nhttp://developer.android.com/guide/topics/ui/actionbar.html#ActionItems", "attachment": [], "flagged": false, "summary": "Android: Enable click event listeners for app icon/app logo in action bar", "creator": { "name": "ayeung", "key": "ayeung", "displayName": "Allen Yeung", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "ayeung", "key": "ayeung", "displayName": "Allen Yeung", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "226201", "author": { "name": "ayeung", "key": "ayeung", "displayName": "Allen Yeung", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Test case:\r\n\r\n1. Set your target sdk version to 14 by adding the entry if your tiapp.xml\"\r\n{code}\r\n \r\n \r\n \r\n \r\n \r\n{code}\r\n\r\n2. Run the following code:\r\n{code}\r\nvar win = Ti.UI.createWindow({\r\n\tfullscreen : true\r\n});\r\n\r\nwin.addEventListener('open', function(){\r\n\tvar actionBar = win.activity.actionBar;\r\n\tactionBar.onHomeIconItemSelected = function() {\r\n\t\tTi.API.info('-------------------Home Icon Selected');\r\n\t}\r\n});\r\n\r\nwin.open();\r\n{code}\r\n3. Click on the app logo on the top left, and you should see the log message pop up in the logs\r\n\r\nThis needs to be tested in v8 and rhino.", "updateAuthor": { "name": "ayeung", "key": "ayeung", "displayName": "Allen Yeung", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-11-05T21:16:42.000+0000", "updated": "2012-11-12T23:36:52.000+0000" }, { "id": "227430", "author": { "name": "igorsantos07", "key": "igorsantos07", "displayName": "Igor Santos", "active": true, "timeZone": "America/Sao_Paulo" }, "body": "Is it possible to add the event this way too?\r\n\r\n{code:javascript}\r\nwin.activity.actionBar.addEventListener('homeIconItemSelected', function() { })\r\n{code}\r\n\r\nI couldn't find in the 3.0 docs yet about the ActionBar object, sorry if I'm being too fast.", "updateAuthor": { "name": "igorsantos07", "key": "igorsantos07", "displayName": "Igor Santos", "active": true, "timeZone": "America/Sao_Paulo" }, "created": "2012-11-15T01:42:35.000+0000", "updated": "2012-11-15T01:42:35.000+0000" }, { "id": "227433", "author": { "name": "ayeung", "key": "ayeung", "displayName": "Allen Yeung", "active": true, "timeZone": "America/Los_Angeles" }, "body": "No, we currently don't support anything like that. You need to add a handler onHomeIconItemSelected as shown above.", "updateAuthor": { "name": "ayeung", "key": "ayeung", "displayName": "Allen Yeung", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-11-15T03:52:11.000+0000", "updated": "2012-11-15T03:52:11.000+0000" }, { "id": "227434", "author": { "name": "igorsantos07", "key": "igorsantos07", "displayName": "Igor Santos", "active": true, "timeZone": "America/Sao_Paulo" }, "body": "Ok, thanks!", "updateAuthor": { "name": "igorsantos07", "key": "igorsantos07", "displayName": "Igor Santos", "active": true, "timeZone": "America/Sao_Paulo" }, "created": "2012-11-15T04:03:28.000+0000", "updated": "2012-11-15T04:03:28.000+0000" }, { "id": "227439", "author": { "name": "igorsantos07", "key": "igorsantos07", "displayName": "Igor Santos", "active": true, "timeZone": "America/Sao_Paulo" }, "body": "I tried to add it to my code now.\r\nThe log command worked just fine, and also worked opening a new window.\r\nAlthough, I tried to run an alert() and fire another event in the same window when the App Icon was clicked, and the application crashed.", "updateAuthor": { "name": "igorsantos07", "key": "igorsantos07", "displayName": "Igor Santos", "active": true, "timeZone": "America/Sao_Paulo" }, "created": "2012-11-15T06:05:02.000+0000", "updated": "2012-11-15T06:05:02.000+0000" }, { "id": "227898", "author": { "name": "aevans", "key": "aevans", "displayName": "Arthur Evans", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Allen,\n\nThis property is missing from ActionBar.yml.", "updateAuthor": { "name": "aevans", "key": "aevans", "displayName": "Arthur Evans", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-11-19T19:03:28.000+0000", "updated": "2012-11-19T19:03:28.000+0000" }, { "id": "241315", "author": { "name": "pmishra", "key": "pmishra", "displayName": "Paras Mishra", "active": true, "timeZone": "Asia/Kolkata" }, "body": "Added the testcase for it.", "updateAuthor": { "name": "pmishra", "key": "pmishra", "displayName": "Paras Mishra", "active": true, "timeZone": "Asia/Kolkata" }, "created": "2013-03-08T07:35:45.000+0000", "updated": "2013-03-08T07:35:45.000+0000" }, { "id": "243375", "author": { "name": "pmishra", "key": "pmishra", "displayName": "Paras Mishra", "active": true, "timeZone": "Asia/Kolkata" }, "body": "Clicking on App icon on actionBar. '-------------------Home Icon Selected' is logged on the console.\r\n\r\nVerifed on:\r\nDevice : Google Nexus 7, Android Version: 4.1\r\nSDK version: 3.1.0.v20130320190115 \r\nCLI version : 3.0.24\r\nOS : MAC OSX 10.7.5\r\n", "updateAuthor": { "name": "pmishra", "key": "pmishra", "displayName": "Paras Mishra", "active": true, "timeZone": "Asia/Kolkata" }, "created": "2013-03-21T10:15:21.000+0000", "updated": "2013-03-21T10:15:21.000+0000" } ], "maxResults": 8, "total": 8, "startAt": 0 } } }