{ "id": "110638", "key": "TIMOB-12962", "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": "15273", "description": "2013 Sprint 05 API", "name": "2013 Sprint 05 API", "archived": true, "released": true, "releaseDate": "2013-03-11" }, { "id": "14815", "description": "2013 Sprint 05", "name": "2013 Sprint 05", "archived": true, "released": true, "releaseDate": "2013-03-11" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2013-03-06T01:54:57.000+0000", "created": "2013-03-05T19:12:04.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "regression" ], "versions": [ { "id": "14164", "description": "Release 3.0.2", "name": "Release 3.0.2", "archived": true, "released": true, "releaseDate": "2013-02-19" } ], "issuelinks": [ { "id": "31297", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "inwardIssue": { "id": "118974", "key": "TIMOB-14947", "fields": { "summary": "Android: WebView crashes on Android 2.3.3 Emulator", "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": "Critical", "id": "1" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2014-06-19T12:44:09.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": "*Problem description*\r\nRun the following test case on Android OS 2.x and SDK 3.0.2 GA to find that the XHR request returns \"Web page not available\". It works fine on later OS versions and SDK 3.0 GA.\r\n\r\n*Test case*\r\n{code}\r\nvar win1 = Titanium.UI.createWindow({\r\n\ttitle : 'Tab 1',\r\n\tbackgroundColor : '#fff',\r\n\texitOnClose : false\r\n});\r\n\r\nvar xhr = Titanium.Network.createHTTPClient({\r\n\tvalidatesSecureCertificate : false,\r\n\tenableKeepAlive : true,\r\n\ttimeout : 10000\r\n});\r\nxhr.onerror = function(e) {\r\n\r\n};\r\nxhr.onload = function() {\r\n\tvar webview = Titanium.UI.createWebView({\r\n\t\thtml : this.responseText\r\n\t});\r\n\twin1.add(webview);\r\n};\r\nxhr.open('GET', \"http://google.com/\");\r\nxhr.send();\r\n\r\nwin1.open();\r\n{code}\r\n\r\n*Solution (baseURL)*\r\n{code}var win1 = Titanium.UI.createWindow({\r\n\ttitle : 'Tab 1',\r\n\tbackgroundColor : '#fff',\r\n\texitOnClose : false\r\n});\r\n\r\nvar xhr = Titanium.Network.createHTTPClient({\r\n\tvalidatesSecureCertificate : false,\r\n\tenableKeepAlive : true,\r\n\ttimeout : 10000\r\n});\r\nxhr.onerror = function(e) {\r\n\r\n};\r\nvar baseURL = \"http://google.com/\";\r\nxhr.onload = function() {\r\n\tvar webview = Titanium.UI.createWebView();\r\n\twebview.setHtml(this.responseText, {\r\n\t\tbaseURL : baseURL\r\n\t});\r\n\twin1.add(webview);\r\n};\r\nxhr.open('GET', baseURL);\r\nxhr.send();\r\n\r\nwin1.open();{code}", "attachment": [], "flagged": false, "summary": "Android: XHR request not working on OS 2.x with SDK 3.0.2 GA", "creator": { "name": "dsefton", "key": "dsefton", "displayName": "Daniel Sefton", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "dsefton", "key": "dsefton", "displayName": "Daniel Sefton", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "SDK 3.0.2 GA\r\nTested on Samsung Galaxy S2 2.3.6", "comment": { "comments": [ { "id": "240868", "author": { "name": "dsefton", "key": "dsefton", "displayName": "Daniel Sefton", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Tested by QE. Confirmed solution to use baseURL property of setHTML(). See solution provided in description.", "updateAuthor": { "name": "dsefton", "key": "dsefton", "displayName": "Daniel Sefton", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-03-06T01:54:57.000+0000", "updated": "2013-03-06T01:54:57.000+0000" } ], "maxResults": 2, "total": 2, "startAt": 0 } } }