{ "id": "90891", "key": "TIMOB-8889", "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": { "id": "7", "description": "", "name": "Invalid" }, "resolutiondate": "2012-06-18T18:16:45.000+0000", "created": "2012-04-25T15:06:57.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [ "api" ], "versions": [ { "id": "12593", "name": "Release 2.0.0", "archived": false, "released": true, "releaseDate": "2012-03-30" } ], "issuelinks": [ { "id": "17578", "type": { "id": "10002", "name": "Duplicate", "inward": "is duplicated by", "outward": "duplicates" }, "inwardIssue": { "id": "61740", "key": "TIMOB-1108", "fields": { "summary": "Android: add allowCancel to ActivityIndicator", "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": "Low", "id": "4" }, "issuetype": { "id": "2", "description": "A new feature of the product, which has yet to be developed.", "name": "New Feature", "subtask": false } } } }, { "id": "17014", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "91213", "key": "TIMOB-8954", "fields": { "summary": "Android: Cancelable ActivityIndicator", "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 } } } } ], "assignee": { "name": "joshroesslein", "key": "joshroesslein", "displayName": "Josh Roesslein", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2017-03-24T18:10: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": "Repro steps:\r\n\r\n1. Run the code below\r\n2. hit back while the activity indicator is running\r\n\r\nExpected result:\r\nYou should see 'back!!!!!!!' in the logs\r\n\r\nActual result:\r\nThe event is never fired.\r\n\r\n\r\nNote, I tried adding the listener to the win1, win2, and activityIndicator with the same results.\r\n{code}\r\nTi.UI.backgroundColor = 'white';\r\n\r\nvar win1 = Ti.UI.createWindow({\r\n backgroundColor: 'blue'\r\n});\r\n\r\nvar win2 = Ti.UI.createWindow({\r\n backgroundColor: 'yellow',\r\n fullscreen: true\r\n});\r\n\r\nvar activityIndicator = Ti.UI.createActivityIndicator({\r\n color: 'green',\r\n font: {fontFamily:'Helvetica Neue', fontSize:26, fontWeight:'bold'},\r\n message: 'Loading...',\r\n style:Ti.UI.iPhone.ActivityIndicatorStyle.DARK,\r\n top:10,\r\n left:10,\r\n height:'auto',\r\n width:'auto'\r\n});\r\n\r\n// On iOS, the activity indicator must be added to a window or view for it to appear\r\nif (Ti.Platform.name === 'iPhone OS'){\r\n win2.add(activityIndicator);\r\n}\r\n\r\n// eventListeners must always be loaded before the event is likely to fire\r\n// hence, the open() method must be positioned before the window is opened\r\nwin2.addEventListener('open', function (e) {\r\n activityIndicator.show();\r\n // do some work that takes 6 seconds\r\n // ie. replace the following setTimeout block with your code\r\n setTimeout(function(){\r\n win2.close();\r\n activityIndicator.hide();\r\n }, 6000);\r\n});\r\n\r\nactivityIndicator.addEventListener('android:back', function(){\r\n\tTi.API.info('back!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!');\r\n});\r\n\r\nwin1.open();\r\nwin2.open();\r\n{code}", "attachment": [], "flagged": false, "summary": "Android: android:back event does not get fired from activity indicator", "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": "193175", "author": { "name": "joshroesslein", "key": "joshroesslein", "displayName": "Josh Roesslein", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Proposed solution:\r\n\r\nExpose a \"cancel\" event on the ActivityIndicator proxy.\r\nFor Android this will be fired when the back button is pressed.\r\nIndicator dialog will be hidden before the event is fired.\r\nThis is only enabled when the property \"cancelable\" is true (false by default).\r\n\r\nBonus:\r\n Android also supports cancelling via a touch outside the dialog.\r\n Could expose this as another property (ex: cancelOnTouch).\r\n\r\nExample:\r\n\r\n{code}\r\nvar indicator = Ti.UI.createActivityIndicator({\r\n message: \"Processing...\",\r\n cancelable: true\r\n});\r\n\r\nindicator.addEventListener('cancel', function() {\r\n // abort the processing here.\r\n});\r\n{code}\r\n\r\nWould this satisfy your use case and solve the issue?", "updateAuthor": { "name": "joshroesslein", "key": "joshroesslein", "displayName": "Josh Roesslein", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-04-30T12:05:58.000+0000", "updated": "2012-04-30T12:05:58.000+0000" }, { "id": "193181", "author": { "name": "joshroesslein", "key": "joshroesslein", "displayName": "Josh Roesslein", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Looks like this will only be an Android API since iOS and Mobile Web don't use modal dialogs\r\nfor the activity indicator.", "updateAuthor": { "name": "joshroesslein", "key": "joshroesslein", "displayName": "Josh Roesslein", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-04-30T13:12:57.000+0000", "updated": "2012-04-30T13:12:57.000+0000" }, { "id": "193780", "author": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Resolved by PR #2118", "updateAuthor": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2012-05-04T13:07:02.000+0000", "updated": "2012-05-04T13:07:02.000+0000" }, { "id": "194253", "author": { "name": "echeng", "key": "echeng", "displayName": "Eric Cheng", "active": true, "timeZone": "America/Los_Angeles" }, "body": "The customer is on 1.8.2. Can the fix be backported to support 1.8.2. Customer delivery date is 5/11.", "updateAuthor": { "name": "echeng", "key": "echeng", "displayName": "Eric Cheng", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-05-09T09:37:04.000+0000", "updated": "2012-05-09T09:37:04.000+0000" }, { "id": "194268", "author": { "name": "ngupta", "key": "ngupta", "displayName": "Neeraj Gupta", "active": true, "timeZone": "America/Los_Angeles" }, "body": "@Eric - We are not porting new features back to older releases. This issue was resolved by implementing a new feature so we cannot put it in 1.8.X branch.", "updateAuthor": { "name": "ngupta", "key": "ngupta", "displayName": "Neeraj Gupta", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-05-09T10:25:33.000+0000", "updated": "2012-05-09T10:25:33.000+0000" }, { "id": "198982", "author": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "body": "This still occurs with SDK 2.1.0.v20120618102300 on a Droid running 2.2.3.", "updateAuthor": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-06-18T15:05:17.000+0000", "updated": "2012-06-18T15:05:17.000+0000" }, { "id": "198989", "author": { "name": "joshroesslein", "key": "joshroesslein", "displayName": "Josh Roesslein", "active": true, "timeZone": "America/Los_Angeles" }, "updateAuthor": { "name": "joshroesslein", "key": "joshroesslein", "displayName": "Josh Roesslein", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-06-18T15:14:53.000+0000", "updated": "2012-06-18T15:14:53.000+0000" }, { "id": "199005", "author": { "name": "joshroesslein", "key": "joshroesslein", "displayName": "Josh Roesslein", "active": true, "timeZone": "America/Los_Angeles" }, "body": "We won't fix the unsupported/undocumented behavior this test case describes here. Instead we implemented the API/feature in TIMOB-8954 to satisfy the customer's use case.", "updateAuthor": { "name": "joshroesslein", "key": "joshroesslein", "displayName": "Josh Roesslein", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-06-18T16:21:43.000+0000", "updated": "2012-06-18T16:21:43.000+0000" }, { "id": "415634", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket as invalid with reference to the above comments.", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-03-24T18:10:54.000+0000", "updated": "2017-03-24T18:10:54.000+0000" } ], "maxResults": 12, "total": 12, "startAt": 0 } } }