Details
-
Type:
Bug
-
Status: Closed
-
Priority:
High
-
Resolution: Fixed
-
Affects Version/s: Release 3.0.2
-
Fix Version/s: Release 3.1.0, 2013 Sprint 05 API, 2013 Sprint 05
-
Component/s: Android
-
Labels:
-
Environment:
SDK 3.0.2 GA
Tested on Samsung Galaxy S2 2.3.6
Description
Problem description
Run 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.
Test case
var win1 = Titanium.UI.createWindow({
|
title : 'Tab 1',
|
backgroundColor : '#fff',
|
exitOnClose : false
|
});
|
|
var xhr = Titanium.Network.createHTTPClient({
|
validatesSecureCertificate : false,
|
enableKeepAlive : true,
|
timeout : 10000
|
});
|
xhr.onerror = function(e) {
|
|
};
|
xhr.onload = function() {
|
var webview = Titanium.UI.createWebView({
|
html : this.responseText
|
});
|
win1.add(webview);
|
};
|
xhr.open('GET', "http://google.com/");
|
xhr.send();
|
|
win1.open();
|
Solution (baseURL)
var win1 = Titanium.UI.createWindow({
|
title : 'Tab 1',
|
backgroundColor : '#fff',
|
exitOnClose : false
|
});
|
|
var xhr = Titanium.Network.createHTTPClient({
|
validatesSecureCertificate : false,
|
enableKeepAlive : true,
|
timeout : 10000
|
});
|
xhr.onerror = function(e) {
|
|
};
|
var baseURL = "http://google.com/";
|
xhr.onload = function() {
|
var webview = Titanium.UI.createWebView();
|
webview.setHtml(this.responseText, {
|
baseURL : baseURL
|
});
|
win1.add(webview);
|
};
|
xhr.open('GET', baseURL);
|
xhr.send();
|
|
win1.open();
|
Attachments
Issue Links
- relates to
-
TIMOB-14947 Android: WebView crashes on Android 2.3.3 Emulator
-
- Closed
-