[TIMOB-9592] Android: Webview: The load event of webview is called twice for invalid url
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Low |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2017-07-11T17:47:26.000+0000 |
Affected Version/s | Release 2.1.0, Release 3.1.0 |
Fix Version/s | n/a |
Components | Android |
Labels | api, qe-and060112 |
Reporter | Satyam Sekhri |
Assignee | Eric Merriman |
Created | 2012-06-17T01:23:43.000+0000 |
Updated | 2017-07-11T17:47:26.000+0000 |
Description
The load event for a webview is fired twice for invalid url.
This is not a regression. This occurs as far as 1.8.2
The issue does not occur on Android 2.2, 2.3 but occurs on 3.2 and 4.0.2
Steps to reproduce:
1. Create app with the code belo
2. Launch app on android device
Actual: The alert for Loaded is shown twice
Expected: The alert should be shown only once i.e. load event should fire only once for invalid url
var _window = Ti.UI.createWindow({
backgroundColor:'#000'
})
var webview=Ti.UI.createWebView({
url:'http://##',
top : 0,
height : 200
});
webview.addEventListener('load', function() {
alert('The webview is loaded!');
});
var b2 = Ti.UI.createButton({
title : "remove and release and add webview",
top : 280
});
b2.addEventListener("click", function() {
_window.remove(webview);
webview.reload();
_window.add(webview);
});
_window.add(webview);
_window.add(b2);
_window.open();
The problem reproduce with release 3.0.2 and master release 3.1.0 tested on Titanium Studio, build: 3.0.1.201212181159 Titanium SDK version: 3.1.0 Titanium SDK version: 3.0.2 Device: Samsung galaxy s duos Android version: 4.0.4 Android Emulator: Android SDK version: 2.2
Verifying that has been fixed as I am unable to reproduce this issue with the following environment; Pixel (7.1) Studio 4.9.0.201705302345 Ti SDK 6.1.1 GA Appc NPM 4.2.9 Appc CLI 6.2.2 Ti CLI 5.0.14 Alloy 1.9.11 Xcode 8.2 (8C38) Node v4.8.2 Java 1.8.0_131