{ "id": "62540", "key": "TIMOB-1908", "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": "13505", "description": "Release 3.0.0", "name": "Release 3.0.0", "archived": true, "released": true, "releaseDate": "2012-12-14" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2013-07-15T06:42:04.000+0000", "created": "2011-04-15T03:05:19.000+0000", "priority": { "name": "Trivial", "id": "5" }, "labels": [ "android", "defect", "module_media", "qe-port", "qe-testadded" ], "versions": [], "issuelinks": [ { "id": "20066", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "94532", "key": "TIMOB-9901", "fields": { "summary": "TiAPI: Review and clean up platform bugs and reduce bug count by 20%.", "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": "7", "description": "gh.issue.story.desc", "name": "Story", "subtask": false } } } } ], "assignee": { "name": "ngupta", "key": "ngupta", "displayName": "Neeraj Gupta", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2013-07-15T06:42:04.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 is yet another context/activity issue.

\n

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    exitOnClose: true\n});\n\nvar btn = Ti.UI.createButton({\n    title: 'contacts'\n});\nbtn.addEventListener('click', function() {\n    Ti.Contacts.showContacts({\n        selectedPerson: function(){Ti.API.info('!!!!!!!!! SELECTED');}\n    });\n});\n\nwin.add(btn);\nwin.open();\n
\n

So in this example, the button to open the picker is in a\nheavyweight window. But the button was placed there -- and the\nlistener added -- from the root context.

\n

Debugging in Eclipse, I can see that the picker activity\nonResult is not even hit.

\n

If you move the code that creates the button/event listener into\nthe heavyweight window's own JS file, it works.

\n

If you look in our \nContactsModule.java on the line where we setup calling the\npicker activity (using TiActivitySupport), you can see we're using\nthe activity of the context, which in our example above will be the\nroot context and therefore not correspond to the Activity of the\nheavyweight window.

{html}", "attachment": [], "flagged": false, "summary": "Android: contacts picker callbacks never fired if showContacts called from other 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": "126957", "author": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "body": "{html}

(from [e56ed6aff77ddba5c17137bd2951a02b911ac1f7])\n[#1908] Workaround for contact picker activity\nonResult not firing if wrong activity is starting the picker: pass\nin a proxy object that represents the correct context from which to\nstart the picker activity. \nhttp://github.com/appcelerator/titanium_mobile/commit/e56ed6aff77dd...

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

(from [a83d7f5c23ce11c0897a963001a77ed786b1faa8])\n[#1908] Better type checking for that optional\nproxy arg. Put back @contextspecific which I'd taken away while\ntesting and forgot to put back before the last commit. \nhttp://github.com/appcelerator/titanium_mobile/commit/a83d7f5c23ce1...

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

(from [c1a4898b161a2bf564ddab74f0d5a3db1c523b52])\n[#1908] Workaround for contact picker activity\nonResult not firing if wrong activity is starting the picker: pass\nin a proxy object that represents the correct context from which to\nstart the picker activity. \nhttp://github.com/appcelerator/titanium_mobile/commit/c1a4898b161a2...

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

(from [e9f9d363491f9fbec474a616503c5cde12d5babd])\n[#1908] Better type checking for that optional\nproxy arg. Put back @contextspecific which I'd taken away while\ntesting and forgot to put back before the last commit. \nhttp://github.com/appcelerator/titanium_mobile/commit/e9f9d363491f9...

{html}", "updateAuthor": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "created": "2011-04-15T03:05:20.000+0000", "updated": "2011-04-15T03:05:20.000+0000" }, { "id": "215374", "author": { "name": "jyounus", "key": "jyounus", "displayName": "Junaid Younus", "active": true, "timeZone": "Europe/London" }, "body": "Tested on a Samsung Galaxy S2 using TiSDK 2.2.0v20120821095711, unable to reproduce the issue. Ticket marked as resolved. ", "updateAuthor": { "name": "jyounus", "key": "jyounus", "displayName": "Junaid Younus", "active": true, "timeZone": "Europe/London" }, "created": "2012-08-21T12:22:24.000+0000", "updated": "2012-08-21T12:22:24.000+0000" }, { "id": "216727", "author": { "name": "amittal", "key": "amittal", "displayName": "Anshu Mittal", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Verified on:\r\nSDK:2.2.0.v20120828153312\r\nStudio:2.1.2.201208281351\r\nDevices: LGp970(v 2.2.2)", "updateAuthor": { "name": "amittal", "key": "amittal", "displayName": "Anshu Mittal", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-08-29T04:40:53.000+0000", "updated": "2012-08-29T04:40:53.000+0000" }, { "id": "216728", "author": { "name": "amittal", "key": "amittal", "displayName": "Anshu Mittal", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Verified on:\r\nSDK:2.2.0.v20120828153312\r\nStudio:2.1.2.201208281351\r\nDevices: LG-p970(v 2.2.2)\r\n\r\nContacts picker callbacks are fired successfully.", "updateAuthor": { "name": "amittal", "key": "amittal", "displayName": "Anshu Mittal", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-08-29T04:45:50.000+0000", "updated": "2012-08-29T04:45:50.000+0000" }, { "id": "261750", "author": { "name": "pagarwal", "key": "pagarwal", "displayName": "Priya Agarwal", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Reopening just to update the label.", "updateAuthor": { "name": "pagarwal", "key": "pagarwal", "displayName": "Priya Agarwal", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-07-15T06:38:24.000+0000", "updated": "2013-07-15T06:38:24.000+0000" }, { "id": "261751", "author": { "name": "pagarwal", "key": "pagarwal", "displayName": "Priya Agarwal", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Updated label and verified with:\r\n\r\nTitanium Studio:3.1.2.201307091843\r\nTitanium SDK: 3.1.2.v20130710144553\r\nacs:1.0.3\r\nalloy:1.1.3\r\nnpm:1.2.14\r\ntitanium:3.1.1\r\nitanium-code-processor:1.0.1\r\nOS: OSX 10.8\r\nDevice:iPhone4 (v 5.1), Galaxy Nexus (v 4.0.4)\r\nXcode: 4.5.1\r\n\r\nContacts picker callbacks are fired successfully.\r\n\r\n\r\n", "updateAuthor": { "name": "pagarwal", "key": "pagarwal", "displayName": "Priya Agarwal", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-07-15T06:42:04.000+0000", "updated": "2013-07-15T06:42:04.000+0000" } ], "maxResults": 9, "total": 9, "startAt": 0 } } }