{ "id": "62586", "key": "TIMOB-1954", "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": "11225", "name": "Release 1.5.0", "archived": true, "released": true, "releaseDate": "2010-12-14" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2011-04-17T01:57:38.000+0000", "created": "2011-04-15T03:06:24.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [ "android", "defect" ], "versions": [], "issuelinks": [], "assignee": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "updated": "2011-04-17T01:57:38.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": "{html}

Sample failcase app.js:

\n
\n/*global Ti, Titanium, alert, JSON */\nTitanium.UI.setBackgroundColor('#000');\nvar win = Titanium.UI.createWindow({  \n    title:'Test',\n    backgroundColor:'#fff',\n    fullscreen: true\n});\n\nfunction clickhandler() {\n    Ti.API.info('HELLO');\n}\n\nvar btn1 = Ti.UI.createButton({\n    top: 0,\n    title: 'Say hello'\n});\nbtn1.addEventListener('click', clickhandler);\n\nwin.add(btn1);\n\nvar btn2 = Ti.UI.createButton({\n    top: 60,\n    title: 'Remove hello click handler'\n});\nbtn2.addEventListener('click', function() {\n    btn1.removeEventListener('click', clickhandler);\n});\nwin.add(btn2);\nwin.open();\n
\n

Note the fullscreen: true in that script. This\nmakes the window being opened a \"heavyweight\" window that gets its\nown activity and context. The code to remove the event listener\nfrom one of the buttons on that window is defined in the root\ncontext. This causes the removeEventListener to have\nno effect.

\n

If you take away the fullscreen: true in the window\ncreation arguments, the removeEventListener will\nsucceed.

\n

EXPECTED BEHAVIOR: The \"HELLO\" message will stop appearing in\nthe console when you click the first button, IF you click\nthe second button at least once.

{html}", "attachment": [], "flagged": false, "summary": "Android: removeEventListener has no effect when removing from a view in another context", "creator": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "subtasks": [], "reporter": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "environment": null, "comment": { "comments": [ { "id": "127070", "author": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "body": "{html}

(from [c6e1d2cdaa30d33e504163c750d55c41dda4063b])\n[#1954 state:fixed-in-qa] Because we don't copy\nover pre-existing event listeners when a proxy switches contexts,\nwhen we remove a listener we need to remove it from the original\ncontext as well \nhttp://github.com/appcelerator/titanium_mobile/commit/c6e1d2cdaa30d...

{html}", "updateAuthor": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "created": "2011-04-15T03:06:25.000+0000", "updated": "2011-04-15T03:06:25.000+0000" }, { "id": "127071", "author": { "name": "thomashuelbert", "key": "thomashuelbert", "displayName": "Thomas Huelbert", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

1.4.2.4ce7ff G1 running 1.6, 2.2 simulator

{html}", "updateAuthor": { "name": "thomashuelbert", "key": "thomashuelbert", "displayName": "Thomas Huelbert", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:06:25.000+0000", "updated": "2011-04-15T03:06:25.000+0000" } ], "maxResults": 2, "total": 2, "startAt": 0 } } }