{ "id": "63594", "key": "TIMOB-2962", "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": "11240", "name": "Release 1.6.0 M07", "archived": true, "released": true, "releaseDate": "2011-01-31" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2011-04-17T02:00:33.000+0000", "created": "2011-04-15T03:33:48.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [ "android", "defect", "facebook", "release-1.5.2", "release-1.6.0", "reported-1.5.2" ], "versions": [], "issuelinks": [], "assignee": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "updated": "2011-04-17T02:00:33.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}

This concerns our facebook \"custom\" module, not the module that\nis in titanium_mobile core. If you use the module in a heavyweight\nwindow, then back out of that window and open it again, you won't\nget any of the module's events starting with that second invocation\nand all following invocations.

\n

To re-create the failcase, create a new project and make the\ntiapp.xml's \"modules\" section look like this:

\n
\n <modules>\n        <module version=\"0.1\">ti.facebook</module>\n    </modules>\n
\n

Next, put the attached ZIP file into the project's root\nfolder.

\n

Next, make app.js look like this:

\n
\nTitanium.UI.setBackgroundColor('#000');\nvar win = Titanium.UI.createWindow({  \n    title:'Test',\n    backgroundColor:'#fff',\n    exitOnClose: true\n});\n\nvar btn = Ti.UI.createButton({\n    title: 'Open heavy window'\n});\nbtn.addEventListener('click', function() {\n    Ti.UI.createWindow({\n        url: 'win.js',\n        backgroundColor: 'black',\n        fullscreen: false\n    }).open();\n});\nwin.add(btn);\nwin.open();\n
\n

And a file, win.js, looking like this:

\n
\nvar win = Ti.UI.currentWindow;\nvar APPID = \"134793934930\";\nvar FB = require(\"ti.facebook\");\nFB.appid = APPID;\nFB.permissions = ['publish_stream', 'create_event'];\n\nvar login = FB.createLoginButton({\n    top: 10, style:'wide'\n});\nwin.add(login);\n\nfunction loginListener() {\n    Ti.API.info('LOGIN LISTENER');\n}\n\nFB.addEventListener('login', loginListener);\n\nwin.addEventListener('close', function() {\n    FB.removeEventListener('login', loginListener);\n});\n\nvar close = Ti.UI.createButton({\n    title: 'Close',\n    bottom: 5, height: 40, left: 20, right: 20\n});\nclose.addEventListener('click', function() {win.close();});\nwin.add(close);\n
\n

Run the project, and follow these steps:

\n
{html}", "attachment": [ { "id": "18246", "filename": "tifacebook-android-01.zip", "author": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "created": "2011-04-15T03:33:48.000+0000", "size": 78617, "mimeType": "application/zip" } ], "flagged": false, "summary": "Android: Facebook module events stop firing on heavyweight windows", "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": "129773", "author": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "body": "{html}

(from [d1a99ef2944f56117511cd1cb450acc5feff18a4])\n[#2962 state:fixed-in-qa] Custom modules -- those\nbrought into being with require() -- are now created instantiated\nwith root activity's context \nhttps://github.com/appcelerator/titanium_mobile/commit/d1a99ef2944f...

{html}", "updateAuthor": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "created": "2011-04-15T03:33:49.000+0000", "updated": "2011-04-15T03:33:49.000+0000" }, { "id": "129774", "author": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "body": "{html}

(from [17baaed6047e515dabe0f238b6d5f5287b30c276])\n[#2962 state:fixed-in-qa] Custom modules -- those\nbrought into being with require() -- are now created instantiated\nwith root activity's context \nhttps://github.com/appcelerator/titanium_mobile/commit/17baaed6047e...

{html}", "updateAuthor": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "created": "2011-04-15T03:33:49.000+0000", "updated": "2011-04-15T03:33:49.000+0000" }, { "id": "129775", "author": { "name": "opiecyrus", "key": "opiecyrus", "displayName": "Opie Cyrus", "active": true, "timeZone": "America/Chicago" }, "body": "{html}

Verified with emulator 2.2.

\n

Login listener fired again when canceling connect prompt the\nsecond time.

{html}", "updateAuthor": { "name": "opiecyrus", "key": "opiecyrus", "displayName": "Opie Cyrus", "active": true, "timeZone": "America/Chicago" }, "created": "2011-04-15T03:33:50.000+0000", "updated": "2011-04-15T03:33:50.000+0000" } ], "maxResults": 3, "total": 3, "startAt": 0 } } }