Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-9592

Android: Webview: The load event of webview is called twice for invalid url

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Low
    • Resolution: Fixed
    • Affects Version/s: Release 2.1.0, Release 3.1.0
    • Fix Version/s: None
    • Component/s: Android
    • Labels:
    • Environment:

      Titanium Studio: 2.1.0.201206151953
      Titanium SDK: 2.1.0.v20120615184153
      Android Device: Android Tab (V3.2), Galaxy Nexus (V4.0.2)
      Runtime: v8

      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();
      

        Attachments

          Activity

            People

            • Assignee:
              emerriman Eric Merriman
              Reporter:
              ssekhri Satyam Sekhri
            • Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Backbone Issue Sync

                • Titanium SDK/CLI <> Titanium Mobile
                  Synced with:
                  TIMOB-13740
                  Sync status:
                  ERROR
                  Last received:
                  Last sent:

                  Git Source Code