{ "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.
\nfailcase 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
\nSo 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.
\nDebugging in Eclipse, I can see that the picker activity\nonResult
is not even hit.
If you move the code that creates the button/event listener into\nthe heavyweight window's own JS file, it works.
\nIf 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.
(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...
(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...
(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...
(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...