Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-9861] Android 2.3.3/2.3.4: Ti.App.fireEvent() and Ti.App.addEventListener() in webView crashes the App

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionCannot Reproduce
Resolution Date2012-08-09T10:30:15.000+0000
Affected Version/sRelease 2.1.0
Fix Version/sn/a
ComponentsAndroid
Labelscore
ReporterCarter Lathrop
AssigneeBill Dawson
Created2012-07-02T16:29:02.000+0000
Updated2017-03-21T22:31:10.000+0000

Description

Problem

When calling Ti.App.fireEvent() or Ti.App.addEventListener() from a webview, it crashes the app.

Sample Code to Reproduce Error:

app.js
var win = Ti.UI.createWindow();
var webView = Ti.UI.createWebView();
var html = '<html>' + '<head>' + '<meta name="viewport" content="width=device-width,user-scalable=yes,initial-scale=1">' + '<script src="global.js"></script>' + '</head>' + '<body>' + 'Hello world!' + '</body>' + '</html>';
webView.html = html;
win.add(webView);
win.open();
global.js
Titanium.App.addEventListener('scrollsContentToTop', function(e){});

Steps to Reproduce Error

1. Add the code above into respective js files 2. Run on android emulator 2.3.3 or 2.3.4 and any Titanium sdk 3. Watch for crash

Comments

  1. Bill Dawson 2012-08-09

    I would expect the crash on a 2.3.x emulator (cf TIMOB-2682) but not on a device. However, The Environment field of this item says "Android 2.3.3 and 2.3.4 *device* and emulator.") Can the submitter please re-confirm that it happens on a real (non-emulator) device? If it does, please include logcat output and the make/model of the device. I don't personally have a 2.3 device, so if it turns out that indeed it's confirmed on the device, this item will need to be reassigned. I ran the test on 2.2, 3.1 and 4.1 devices just for a sanity check, and there were no crashes.
  2. Wensheng Chen 2012-08-09

    There is a reason why the ticket specifically says Android 2.3.3 and 2.3.4 device and emulator. You have to test on these versions to reproduce the problem.
  3. Allen Yeung 2012-08-09

    I tested this on Titanium 2.1.0, 2.0.2 sdks with a android 2.3.6 and a 2.3.4 devices and could not reproduce the issue. Marking this as cannot reproduce.
  4. Lee Morris 2017-03-21

    Closing ticket as the issue cannot be reproduced and due to the above comments.

JSON Source