{ "id": "87979", "key": "TIMOB-8023", "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": "12593", "name": "Release 2.0.0", "archived": false, "released": true, "releaseDate": "2012-03-30" }, { "id": "13170", "name": "Sprint 2012-06", "archived": true, "released": true, "releaseDate": "2012-03-25" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2012-04-19T16:07:14.000+0000", "created": "2012-03-14T15:51:56.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "module_webview", "qe-testadded" ], "versions": [ { "id": "12580", "description": "Dual Runtime 1.8.0", "name": "Release 1.8.0.1", "archived": true, "released": true, "releaseDate": "2011-12-22" }, { "id": "12677", "description": "Release 1.8 Service Pack 1", "name": "Release 1.8.1", "archived": true, "released": true, "releaseDate": "2012-01-31" }, { "id": "13070", "description": "Release 1.8 Service Pack 2", "name": "Release 1.8.2", "archived": true, "released": true, "releaseDate": "2012-02-29" } ], "issuelinks": [ { "id": "22909", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "inwardIssue": { "id": "105143", "key": "TIMOB-11804", "fields": { "summary": "Android: WebView - App crashes on Motorola RAZR i", "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": "Low", "id": "4" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": { "name": "opiecyrus", "key": "opiecyrus", "displayName": "Opie Cyrus", "active": true, "timeZone": "America/Chicago" }, "updated": "2012-11-16T22:52:07.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": "Unable to pass the path of the picture that was taken by the camera to the webview using evalJS. It results in the crash of the app. This works fine in iOS.\r\nh4. Repro Steps\r\n1. Run the below code.\r\n2. Click the Take Picture button. It will open the camera. \r\n3. Take the picture and click Ok button of the camera. It will crash the app.\r\nh4. Expected behavior: Alert with the image path should pop up.\r\n{code:title=app.js}\r\nvar tabGroup = Titanium.UI.createTabGroup();\r\n \r\nvar win4 = Titanium.UI.createWindow({\r\n title: \"HTML\",\r\n url:\"windows/win4.js\"\r\n});\r\nvar tab4 = Titanium.UI.createTab({\r\n title: \"HTML\",\r\n window: win4\r\n}); \r\n \r\ntabGroup.addTab(tab4);\r\ntabGroup.open();\r\n{code}\r\n\r\n{code:title=win4.js}\r\nvar win = Titanium.UI.currentWindow;\r\nvar webview = Titanium.UI.createWebView({url:'win4.html'});\r\nwin.add(webview);\r\n \r\nTi.App.addEventListener('showCamera', function() {\r\n Titanium.Media.showCamera({ \r\n success:function(event) \r\n {\r\n var imageView = Ti.UI.createImageView({image:event.media});\r\n var cropRect = event.cropRect;\r\n var image = event.media;\r\n var file = Titanium.Filesystem.getFile(Titanium.Filesystem.applicationDataDirectory,'photo.png');\r\n file.write(image);\r\n var data = file.nativePath;\r\n //alert(data);\r\n webview.evalJS('imgPass(\"' + data + '\");');\r\n },\r\n cancel:function()\r\n {\r\n },\r\n error:function(error)\r\n {\r\n var a = Titanium.UI.createAlertDialog({title:'Camera'});\r\n if (error.code == Titanium.Media.NO_CAMERA)\r\n {\r\n a.setMessage('Please run this test on device');\r\n }\r\n else\r\n {\r\n a.setMessage('Unexpected error: ' + error.code);\r\n }\r\n a.show();\r\n },\r\n mediaTypes:Ti.Media.MEDIA_TYPE_PHOTO,\r\n saveToPhotoGallery:true,\r\n allowEditing:true\r\n });\r\n});\r\n{code}\r\n\r\n{code:title=win4.html}\r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n Take Picture \r\n \r\n \r\n\r\n{code}\r\n", "attachment": [], "flagged": false, "summary": "Android: Unable to pass variable to webview from successful showCamera using evalJS", "creator": { "name": "nsharma", "key": "nsharma", "displayName": "Nikhil Sharma", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "nsharma", "key": "nsharma", "displayName": "Nikhil Sharma", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "android 2.2.2\r\nLG Optimus V\r\nTi SDK 2.0.x CI build", "comment": { "comments": [ { "id": "187225", "author": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Verified fixed with 2.0.0.v20120319003254 and Titanium Studio, build: 2.0.0.201203182248. Image was captured and alert presented on Nexus S 2.3.6.", "updateAuthor": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-03-19T15:17:33.000+0000", "updated": "2012-03-19T15:17:33.000+0000" }, { "id": "191945", "author": { "name": "wluu", "key": "wluu", "displayName": "Wilson Luu", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Reopening to update labels.", "updateAuthor": { "name": "wluu", "key": "wluu", "displayName": "Wilson Luu", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2012-04-19T16:06:56.000+0000", "updated": "2012-04-19T16:06:56.000+0000" } ], "maxResults": 2, "total": 2, "startAt": 0 } } }