{ "id": "133962", "key": "TIMOB-17553", "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": [], "resolution": null, "resolutiondate": null, "created": "2014-07-31T11:31:09.000+0000", "priority": { "name": "None", "id": "6" }, "labels": [ "Android", "DatePicker", "Picker", "TCSupport" ], "versions": [ { "id": "15422", "description": "Release 3.3.0", "name": "Release 3.3.0", "archived": false, "released": true, "releaseDate": "2014-07-16" } ], "issuelinks": [], "assignee": null, "updated": "2018-02-28T20:04:22.000+0000", "status": { "description": "The issue is open and ready for the assignee to start work on it.", "name": "Open", "id": "1", "statusCategory": { "id": 2, "key": "new", "colorName": "blue-gray", "name": "To Do" } }, "components": [ { "id": "10202", "name": "Android", "description": "Android Platform" } ], "description": "h4. Problem Description\r\nOn android the datepicker always returns \"cancel:false\" (if you cancel or accept)\r\n\r\nIf you press cancel (back button or press outside the modal popup)\r\nthe function callback gets called 1time\r\n\r\nif you accept the date\r\nthe function callback gets called 2 times\r\n\r\nh4. Steps to reproduce\r\n- Create a simple project.\r\n- Paste the testcase into app.js\r\n- Run on android tab\r\n\r\nh4. Testcase\r\n{code:javascript}\r\nvar win = Ti.UI.createWindow({title:'test'});\r\nwin.open();\r\nvar picker = Ti.UI.createPicker({value : new Date(),type: Ti.UI.PICKER_TYPE_DATE});\r\nvar pickDateButton = Ti.UI.createButton({title:'pick a date'});\r\nwin.add(pickDateButton);\r\npickDateButton.addEventListener('click',function(){\r\n picker.showDatePickerDialog({\r\n value:new Date(),\r\n callback:function(e){\r\n Ti.API.info('picked date: '+JSON.stringify(e));\r\n }\r\n });\r\n});\r\n{code}\r\n\r\nh4. Workaround\r\nTo avoid this bug I ignore the cancel property in the callback, and I check how many times the callback function gets executed. \r\n", "attachment": [], "flagged": false, "summary": "Android: showDatePickerDialog cancel property always false and callback called twice", "creator": { "name": "bar b", "key": "bar b", "displayName": "Bar Bruy", "active": true, "timeZone": "Europe/Berlin" }, "subtasks": [], "reporter": { "name": "bar b", "key": "bar b", "displayName": "Bar Bruy", "active": true, "timeZone": "Europe/Berlin" }, "environment": "Android\r\nTested with\r\nTitanium SDK 3.3.0\r\nGenymotion nexus 7 (2013)\r\nLG G Tab 8.3", "comment": { "comments": [ { "id": "320247", "author": { "name": "mpmiranda", "key": "mpmiranda", "displayName": "Mauro Parra-Miranda", "active": true, "timeZone": "America/Mexico_City" }, "body": "Thanks for your report! The Platform team will set the priority on this issue. ", "updateAuthor": { "name": "mpmiranda", "key": "mpmiranda", "displayName": "Mauro Parra-Miranda", "active": true, "timeZone": "America/Mexico_City" }, "created": "2014-08-26T00:26:12.000+0000", "updated": "2014-08-26T00:26:12.000+0000" } ], "maxResults": 3, "total": 3, "startAt": 0 } } }