{ "id": "62227", "key": "TIMOB-1595", "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": "2012-08-15T14:43:33.000+0000", "created": "2011-04-15T02:56:57.000+0000", "priority": { "name": "Low", "id": "4" }, "labels": [ "module_window", "qe-review", "qe-testadded" ], "versions": [], "issuelinks": [ { "id": "19947", "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": "2012-09-10T03:26:29.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}
When calling Titanium.Media.openPhotoGallery or .showCamera from\na modal windows on Android, the camera/gallery dialogs show and\noperate but my success, cancel, and error callbacks never get\ncalled so my application can't process the image. This is a problem\nfor our StatusNet Mobile social networking client, which needs to\nbe able to take or select photos from a modal message-compose\ndialog.
\n\nvar window = Titanium.UI.createWindow({\n title: \"Photo test\",\n backgroundColor: 'black'\n});\nvar button = Titanium.UI.createButton({\n left: 20,\n right: 20,\n top: 120,\n height: 32,\n title: \"Push me\"\n});\n\nbutton.addEventListener('click', function() {\n var popoverView;\n var arrowDirection;\n Titanium.Media.openPhotoGallery({\n \n success:function(event) {\n Titanium.API.info('Success!');\n },\n cancel:function()\n {\n Titanium.API.info('Cancel!');\n },\n error:function(error)\n {\n Titanium.API.info('Error!');\n },\n allowEditing:true,\n mediaTypes:[Ti.Media.MEDIA_TYPE_VIDEO,Ti.Media.MEDIA_TYPE_PHOTO],\n });\n});\n\nwindow.add(button);\nwindow.open({\n modal: true\n});
\n
\nRemoving the 'modal: true' makes it work just fine, and I see\noutput in the debug log when my callbacks fire.
\nTesting current git builds of mobile, on Android 2.2 + APIs.
Turns out this is affecting all heavyweight windows, not just\nmodals -- so that includes those with fullscreen or navBarHidden\nset as well.
\nThis is a release blocker for StatusNet Mobile, since we've\ngotten back-button navigation working in Android by using\nheavyweight windows for each level, and have also removed the\nsystem title bar by putting navBarHidden on all the windows which\nalso turns them into heavyweight windows.
\nAssigning to our support contact; we'll also file a helpdesk\nrequest referencing this bug.
Suggested workaround from support was to call from inside the\nheavyweight window's context (so giving it a url with its own\nlittle .js file) and pass the data back to the main context through\napplication-wide events.
\nThis seems to do the job for now, though we had issues with\nwriting the blobs to temporary files (fixed in f2eca06d -- thanks\nto Marshall for that fix!)
The callbacks actually do get called, but not until you back out\nof that heavyweight window. (which for all intents and purposes is\nas annoying as them not getting called at all. :) )
\nSince the workaround (giving your heavyweight window its own .js\nand putting event logic for its controls in there -- which is\nsomething I always do and recommend) is working okay for you, I'm\nbumping this down to 'medium.' We have a re-engineering of our\ncontexts already under way for a future release, so we'll have to\nsee how this use case fits in when we have that ready to test.
Great, thanks for looking into it!