{ "id": "86936", "key": "AC-3109", "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-04-01T22:51:42.000+0000", "created": "2012-02-24T01:46:45.000+0000", "labels": [], "versions": [], "issuelinks": [], "assignee": { "name": "fcasali", "key": "fcasali", "displayName": "Federico Casali", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2016-03-08T07:48:10.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": "h3. The problem\r\n\r\n\r\n\r\nHeavyweight window can't be closed using hardware back-button when it has \"android:back\" event listener attached.\r\n\r\n\r\n\r\nh3. Test case\r\n\r\n\r\n\r\nTo see this problem run this example:\r\n\r\n\r\n{code:lang=javascript|title=app.js}\r\n\r\nvar win = Ti.UI.createWindow({\r\n\tbackgroundColor: '#000'\r\n});\r\n\r\nvar button = Ti.UI.createButton({\r\n\ttitle: 'Open window'\r\n});\r\n\r\nbutton.addEventListener('click', function() {\r\n\t\r\n var win1 = Ti.UI.createWindow({\r\n \ttitle: 'Click back button',\r\n \tmodal: true,\r\n \tbackgroundColor: '#369'\r\n });\r\n \r\n\twin1.addEventListener('android:back', function() {\r\n\t\tTi.API.info('Android:back');\r\n\t});\r\n\t\r\n\twin1.open();\r\n\t\r\n});\r\n\r\nwin.add(button);\r\n\r\nwin.open();\r\n\r\n{code}\r\n\r\n\r\nClick on button and then try to close a window using hardware back-button. You should see that window did not close, while event has been fired as it can be seen in console output.\r\n\r\n\r\n\r\nh3. Expected behavior\r\n\r\n\r\n\r\nWindow needs to be closed when hardware back-button is clicked. Note that this works fine when example is compiled with 1.8.1 SDK.", "attachment": [], "flagged": false, "summary": "Android: Hardware back-button does not function when \"android:back\" event listener is attached to heavyweight window", "creator": { "name": "ivan.skugor", "key": "ivan.skugor", "displayName": "Ivan Skugor", "active": true, "timeZone": "Europe/Amsterdam" }, "subtasks": [], "reporter": { "name": "ivan.skugor", "key": "ivan.skugor", "displayName": "Ivan Skugor", "active": true, "timeZone": "Europe/Amsterdam" }, "environment": "* Titanium SDK version: 1.8.2 (02/23/12 17:46 59b3a90)\r\n* v8\r\n* Android 3.1\r\n* Thinkpad Tablet\r\n* Windows XP", "comment": { "comments": [ { "id": "184144", "author": { "name": "ivan.skugor", "key": "ivan.skugor", "displayName": "Ivan Skugor", "active": true, "timeZone": "Europe/Amsterdam" }, "body": "Just to add ... it seems that tabgroup also can't be closed using hardware back-button when some window in it has \"android:back\" event attached.", "updateAuthor": { "name": "ivan.skugor", "key": "ivan.skugor", "displayName": "Ivan Skugor", "active": true, "timeZone": "Europe/Amsterdam" }, "created": "2012-02-24T01:49:49.000+0000", "updated": "2012-02-24T01:49:49.000+0000" }, { "id": "187335", "author": { "name": "ivan.skugor", "key": "ivan.skugor", "displayName": "Ivan Skugor", "active": true, "timeZone": "Europe/Amsterdam" }, "body": "This seems to be fixed in latest CI, so it can be closed.", "updateAuthor": { "name": "ivan.skugor", "key": "ivan.skugor", "displayName": "Ivan Skugor", "active": true, "timeZone": "Europe/Amsterdam" }, "created": "2012-03-20T05:27:33.000+0000", "updated": "2012-03-20T05:27:33.000+0000" }, { "id": "189427", "author": { "name": "fcasali", "key": "fcasali", "displayName": "Federico Casali", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Not able to reproduce.\r\nPlease note that in the example above, the only result that should be noticed clicking on the back button is to display the 'Android:back' in the console log.\r\nTo also close the window, 'win1.close()' should also be added in the eventListener.", "updateAuthor": { "name": "fcasali", "key": "fcasali", "displayName": "Federico Casali", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-04-01T22:51:16.000+0000", "updated": "2012-04-01T22:51:16.000+0000" } ], "maxResults": 3, "total": 3, "startAt": 0 } } }