{ "id": "171539", "key": "TIMOB-25977", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "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": "20115", "name": "Release 7.3.0", "archived": false, "released": true, "releaseDate": "2018-08-17" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2018-04-19T22:36:14.000+0000", "created": "2018-04-19T14:31:26.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [ "alertdialog", "andoid", "eventlistener", "parity" ], "versions": [ { "id": "19957", "description": "", "name": "Release 7.1.0", "archived": false, "released": true, "releaseDate": "2018-03-14" } ], "issuelinks": [ { "id": "56465", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "171437", "key": "TIMOB-25919", "fields": { "summary": "Android: OptionDialog not firing \"click\" event for cancel button like iOS", "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": "Medium", "id": "3" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2018-06-19T17:58:42.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": "The alert dialog doesn't fire a cancel event if you press outside of the alertDialog box in 7.1.0. The event listener actually doesn't console anything if done this way. If you switch it back to 6.2.2 it works correctly and fires the eventlistener when the user touches outside of the alert dialog.\r\n\r\nMake a sample AppSellHerHater project and paste the index.js below. Then build to android on 7.1.0 and watch it not work. Then build with 6.2.2 and watch it work correctly.\r\n\r\n{code:java}\r\n//Replace the index.js code with this\r\nfunction doClick(e) {\r\n\tmyAlert.show();\r\n}\r\n\r\n$.index.open();\r\n\r\nvar myAlert = Ti.UI.createAlertDialog({\r\n\tcancel: 1,\r\n\tbuttonNames: ['Ok', 'Cancel'],\r\n\tmessage: \"Event listener doesn't fire if you press outside of alert on android...\",\r\n\ttitle: 'Confirm Ok'\r\n});\r\n\r\nmyAlert.addEventListener('click', function(e) {\r\n\tconsole.info('e.index: ' + e.index);\r\n\t$.label.text = (e.index == 0) ? \"You pressed 'Ok'...\" : \"You cancelled the alert...\";\r\n\talert('e.index: ' + e.index);\r\n});\r\n{code}\r\n", "attachment": [], "flagged": false, "summary": "Android: AlertDialog not firing \"click\" event when canceled", "creator": { "name": "josh.mocek", "key": "josh.mocek", "displayName": "josh.mocek", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "josh.mocek", "key": "josh.mocek", "displayName": "josh.mocek", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "Android. This doesn't work in 7.1.0, but in 6.2.2 it works.", "closedSprints": [ { "id": 1021, "state": "closed", "name": "2018 Sprint 08 SDK", "startDate": "2018-04-08T17:57:36.122Z", "endDate": "2018-04-22T17:57:00.000Z", "completeDate": "2018-04-22T22:51:19.120Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "437015", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "I believe the change for [TIMOB-25919] will resolve this issue as well.\r\nThat ticket's change is scheduled to be made in Titanium 7.2.0. Stay tuned.", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-04-19T20:01:55.000+0000", "updated": "2018-04-19T20:01:55.000+0000" }, { "id": "437016", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Classic app test code...\r\n\r\n{code:javascript}\r\nvar window = Ti.UI.createWindow();\r\nvar button = Ti.UI.createButton({ title: \"Show Alert\" });\r\nbutton.addEventListener(\"click\", function(e) {\r\n\tvar dialog = Ti.UI.createAlertDialog({\r\n\t\ttitle: \"Alert Dialog\",\r\n\t\tmessage: \"This is the alert message.\",\r\n\t\tbuttonNames: [\"OK\", \"Cancel\", \"Maybe\"],\r\n\t\tcancel: 1,\r\n\t});\r\n\tdialog.addEventListener(\"click\", function(e) {\r\n\t\tTi.API.info(\"@@@ Dialog 'click' index: \" + e.index + \", button: \" + e.button + \", cancel: \" + e.cancel);\r\n\t});\r\n\tdialog.show();\r\n});\r\nwindow.add(button);\r\nwindow.open();\r\n{code}\r\n", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-04-19T20:07:03.000+0000", "updated": "2018-04-19T20:11:37.000+0000" }, { "id": "437019", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Confirmed fixed by [TIMOB-25919]", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-04-19T22:36:14.000+0000", "updated": "2018-04-19T22:36:14.000+0000" }, { "id": "437170", "author": { "name": "josh.mocek", "key": "josh.mocek", "displayName": "josh.mocek", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Just making sure this is also resolved for when the back button is pressed?", "updateAuthor": { "name": "josh.mocek", "key": "josh.mocek", "displayName": "josh.mocek", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-04-26T19:20:21.000+0000", "updated": "2018-04-26T19:20:21.000+0000" }, { "id": "437171", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Yes. We've confirmed that pressing the back button will fire a \"click\" event matching the cancel button index as well with the above fix.", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-04-26T19:29:08.000+0000", "updated": "2018-04-26T19:29:08.000+0000" }, { "id": "438529", "author": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Verified the fix with SDK 7.3.0.v20180618182516.\r\n\r\nClosing.", "updateAuthor": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-06-19T17:58:36.000+0000", "updated": "2018-06-19T17:58:36.000+0000" } ], "maxResults": 6, "total": 6, "startAt": 0 } } }