{ "id": "86976", "key": "TIMOB-7808", "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": "12097", "description": "", "name": "Sprint 2012-05", "archived": true, "released": true, "releaseDate": "2012-03-11" }, { "id": "12593", "name": "Release 2.0.0", "archived": false, "released": true, "releaseDate": "2012-03-30" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2012-05-03T17:33:12.000+0000", "created": "2012-02-24T14:11:47.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "module_webview", "qe-testadded" ], "versions": [ { "id": "11331", "description": "", "name": "Release 1.8.0", "archived": true, "released": true, "releaseDate": "2011-10-31" } ], "issuelinks": [ { "id": "38093", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "inwardIssue": { "id": "130882", "key": "TIMOB-17027", "fields": { "summary": "iOS: The webview reloads on being removed and re-add to a window", "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": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": { "name": "pwang", "key": "pwang", "displayName": "Ping Wang", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2014-06-04T21:42:53.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": "This is a regression. When you try to move a webview from one view to another on Android using Titanium SDK 1.8.x and further, the webview reloads. It doesn't do this on iOS using any Titanium SDK. And it doesn't do it on Android when using Ti SDK 1.7.x.\r\n\r\nThe test case below shows that even removing the webview from a window and putting it back again makes it reload.\r\n\r\n{code:title=app.js|borderStyle=solid}\r\nvar win = Ti.UI.createWindow();\r\n\r\n// It doesn't matter if the webview is created using `html` or`url`\r\n// When loaded, the webview shows the current timestamp.\r\nvar webview = Ti.UI.createWebView({\r\n html: ''\r\n});\r\n\r\nvar onload = function(){\r\n // Actually, we could see that the load event would fires twice on Android,\r\n // but I want to really prove that the content actually reloads\r\n webview.removeEventListener('load', onload);\r\n\r\n var before = webview.evalJS('now');\r\n\r\n // Just removing the webview and adding it back again makes it reload on Android when using Ti SDK 1.8.x\r\n win.remove(webview);\r\n win.add(webview);\r\n\r\n // Give Android time to breathe\r\n setTimeout(function(){\r\n var after = webview.evalJS('now');\r\n alert('The webview ' + (before == after ? \"HASN'T\" : \"HAS\") + ' reloaded!');\r\n }, 500);\r\n\r\n};\r\nwebview.addEventListener('load', onload);\r\n\r\nwin.add(webview);\r\nwin.open();\r\n{code}\r\n\r\nThe issue was raised by one of the Appcelerator Titans.", "attachment": [], "flagged": false, "summary": "Android: Webview reloads when removed and re-added. Regression from 1.7.5", "creator": { "name": "vjoshi", "key": "vjoshi", "displayName": "Varun Joshi", "active": true, "timeZone": "America/New_York" }, "subtasks": [], "reporter": { "name": "vjoshi", "key": "vjoshi", "displayName": "Varun Joshi", "active": true, "timeZone": "America/New_York" }, "environment": "Product: Mobile\r\nTitanium SDK: Mobile 1.8.0.1\r\nPlatform OS: Android\r\nPlatform OS Version: 2.2", "comment": { "comments": [ { "id": "185078", "author": { "name": "pwang", "key": "pwang", "displayName": "Ping Wang", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Another test case:\r\n{code}\r\n\r\nvar win = Ti.UI.createWindow({backgroundColor: 'black'});\r\n\r\nvar webview = Ti.UI.createWebView({\r\n html: '',\r\n top: 0,\r\n height: 300\r\n});\r\n\r\nwebview.addEventListener('load', function(){\r\n\talert('The webview is loaded!');\r\n});\r\n\r\nvar b = Ti.UI.createButton({\r\n\ttitle: \"remove and add webview\",\r\n\ttop: 400\r\n});\r\nb.addEventListener(\"click\", function(){\r\n\twin.remove(webview);\r\n\twin.add(webview);\r\n});\r\n\r\nvar b2 = Ti.UI.createButton({\r\n\ttitle: \"remove and release and add webview\",\r\n\ttop: 500\r\n});\r\nb2.addEventListener(\"click\", function(){\r\n\twin.remove(webview);\r\n\twebview.release();\r\n\twin.add(webview);\r\n});\r\n\r\nwin.add(webview);\r\nwin.add(b);\r\nwin.add(b2);\r\nwin.open();\r\n{code}\r\n\r\nTesting steps:\r\n1. run the above code\r\n2. click \"remove and add webview\". should not see any alert dialog.\r\n3. click \"remove and release and add webview\". should see the alert dialog.", "updateAuthor": { "name": "pwang", "key": "pwang", "displayName": "Ping Wang", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-03-05T14:29:47.000+0000", "updated": "2012-03-05T14:29:47.000+0000" }, { "id": "186896", "author": { "name": "dhyde", "key": "dhyde", "displayName": "Dustin Hyde", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Closing as Fixed.\r\n\r\nUsed Ping's Code.\r\n\r\nBehaved as Expected:\r\n\r\n1. app start: load event\r\n2. 'Remove and add webview': no reload event.\r\n3. 'remove and release and add webview': reload event\r\n\r\nSDK: 2.0.0.v20120316130302\r\nAndroid: V8, Rhino\r\nStudio: 2.0.0.201203152033\r\nOS: Snow Leopard\r\nDevices Tested: Nexus One 2.2.2", "updateAuthor": { "name": "dhyde", "key": "dhyde", "displayName": "Dustin Hyde", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-03-16T14:58:49.000+0000", "updated": "2012-03-16T14:58:49.000+0000" }, { "id": "193602", "author": { "name": "nhuynh", "key": "nhuynh", "displayName": "Natalie Huynh", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Open to update label", "updateAuthor": { "name": "nhuynh", "key": "nhuynh", "displayName": "Natalie Huynh", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-05-03T11:49:21.000+0000", "updated": "2012-05-03T11:49:21.000+0000" } ], "maxResults": 3, "total": 3, "startAt": 0 } } }