Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-9592] Android: Webview: The load event of webview is called twice for invalid url

GitHub Issuen/a
TypeBug
PriorityLow
StatusClosed
ResolutionFixed
Resolution Date2017-07-11T17:47:26.000+0000
Affected Version/sRelease 2.1.0, Release 3.1.0
Fix Version/sn/a
ComponentsAndroid
Labelsapi, qe-and060112
ReporterSatyam Sekhri
AssigneeEric Merriman
Created2012-06-17T01:23:43.000+0000
Updated2017-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();

Comments

  1. Shameer Jan 2013-03-05

    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
  2. Lee Morris 2017-07-11

    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

JSON Source