{ "id": "108578", "key": "TIMOB-12425", "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": "14162", "description": "Release 3.1.0", "name": "Release 3.1.0", "archived": true, "released": true, "releaseDate": "2013-04-16" }, { "id": "15104", "description": "2013 Sprint 03 API", "name": "2013 Sprint 03 API", "archived": true, "released": true, "releaseDate": "2013-02-11" }, { "id": "14813", "description": "2013 Sprint 03", "name": "2013 Sprint 03", "archived": true, "released": true, "releaseDate": "2013-02-11" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2013-02-08T00:08:20.000+0000", "created": "2013-01-25T19:54:56.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [], "versions": [ { "id": "14162", "description": "Release 3.1.0", "name": "Release 3.1.0", "archived": true, "released": true, "releaseDate": "2013-04-16" } ], "issuelinks": [], "assignee": { "name": "pwang", "key": "pwang", "displayName": "Ping Wang", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2014-06-19T12:44:24.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": "Steps to reproduce:\r\n1. Run the code attached below.\r\n2. Two alerts show which means the \"load\" event is fired twice. Expected behavior: load should be only fired once.\r\nNote: \r\ni) if commenting out webview.setHtml(\"xxx\") but use webview.html=\"xxx\", the \"load\" event will be only fired once.\r\nii) if running on Galaxy Nexus (4.0.4), a warning shows in the console, like\r\n{quote}\r\nW/webview ( 2264): java.lang.Throwable: Warning: A WebView method was called on thread 'KrollRuntimeThread'. All WebView methods must be called on the UI thread. Future versions of WebView may not support use on other threads.\r\n{quote}\r\n{code}\r\nvar _window = Ti.UI.createWindow({\r\n\tbackgroundColor : '#000'\r\n})\r\n\r\nvar webview = Ti.UI.createWebView({\r\n\ttop : 0,\r\n\theight : 200\r\n});\r\n\r\nwebview.setHtml('test');\r\n//webview.html = 'test';\r\n\r\nwebview.addEventListener('load', function() {\r\n\talert('The webview is loaded!');\r\n});\r\n\r\n_window.add(webview);\r\n_window.open(); \r\n{code}", "attachment": [], "flagged": false, "summary": "Android: WebView: the \"load\" event is fired twice if setHtml() is called before the window opens", "creator": { "name": "pwang", "key": "pwang", "displayName": "Ping Wang", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "pwang", "key": "pwang", "displayName": "Ping Wang", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "236359", "author": { "name": "pwang", "key": "pwang", "displayName": "Ping Wang", "active": true, "timeZone": "America/Los_Angeles" }, "body": "PR https://github.com/appcelerator/titanium_mobile/pull/3813", "updateAuthor": { "name": "pwang", "key": "pwang", "displayName": "Ping Wang", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-01-29T01:28:36.000+0000", "updated": "2013-01-29T01:28:36.000+0000" }, { "id": "239375", "author": { "name": "pmishra", "key": "pmishra", "displayName": "Paras Mishra", "active": true, "timeZone": "Asia/Kolkata" }, "body": "Load event fired once.\r\n\r\nVerified on :\r\nGoogle Nexus, android :4.1\r\nSDK version: 3.1.0.v20130220200300\r\nCLI version : 3.0.24\r\nOS : MAC OSX 10.7.5\r\nXCode : 4.5.1", "updateAuthor": { "name": "pmishra", "key": "pmishra", "displayName": "Paras Mishra", "active": true, "timeZone": "Asia/Kolkata" }, "created": "2013-02-22T10:42:03.000+0000", "updated": "2013-02-22T10:42:03.000+0000" } ], "maxResults": 2, "total": 2, "startAt": 0 } } }