{ "id": "62006", "key": "TIMOB-1374", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [], "resolution": { "id": "3", "description": "The problem is a duplicate of an existing issue.", "name": "Duplicate" }, "resolutiondate": "2011-04-15T02:50:42.000+0000", "created": "2011-04-15T02:50:41.000+0000", "priority": { "name": "Trivial", "id": "5" }, "labels": [ "android", "event", "webview" ], "versions": [], "issuelinks": [], "assignee": { "name": "dthorp", "key": "dthorp", "displayName": "Don Thorp", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2017-03-09T23:47:30.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "10202", "name": "Android", "description": "Android Platform" } ], "description": "{html}

This sniplets are working under all versions of simulator, but\nwhen I install the application on Android 2.2 (Nexus One), events\nare not working.
\nSo I can't pass data between windows and webviews.

\n

win.js

\n

var win = Ti.UI.currentWindow;

\n

var webCurView = Ti.UI.createWebView({url:'web2.html'});

\n

webCurView.addEventListener('load', function() {

\n
\nTitanium.App.fireEvent('pageReady',{latx:39.92, lngx:32.80, laty:39.86, lngy: 32.85});\n
\n

});

\n

win.add(webCurView);

\n

web2.html

{html}", "attachment": [], "flagged": false, "summary": "Android: Events are not working on Android 2.2 device, but working on simulator", "creator": { "name": "alperdincer", "key": "alperdincer", "displayName": "Alper Dincer", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "alperdincer", "key": "alperdincer", "displayName": "Alper Dincer", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "125490", "author": { "name": "brionvibber", "key": "brionvibber", "displayName": "Brion Vibber", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

The problem I have is that the Titanium object (and thus\nTitanium.App.addEventListener) is undefined in the web view's\nJavaScript when launched on a Nexus One running the official\nAndroid 2.2 release. As with Alper's report, everything works fine\nin the emulator (2.2-APIs).

{html}", "updateAuthor": { "name": "brionvibber", "key": "brionvibber", "displayName": "Brion Vibber", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T02:50:42.000+0000", "updated": "2011-04-15T02:50:42.000+0000" }, { "id": "125491", "author": { "name": "brionvibber", "key": "brionvibber", "displayName": "Brion Vibber", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

I was able to work around this for my case by re-including the\nsystem's binding.js in my HTML file; I think there's some order of\noperations problem where it's getting evaluated when the WebView is\nset up, but before the TiApp and TiAPI objects are fully available\nyet:

\n

E/Web Console( 2106): Uncaught ReferenceError: TiAPI is not\ndefined at :3

\n

I've simply copied binding.js from here:
\n\nhttp://github.com/appcelerator/titanium_mobile/blob/master/android/...

\n

and dropped it into my HTML before my own scripts:

\n<!-- hack for initialization bug on Android --> Since it\nchecks for the short-form 'Ti' already being set up in the global\nnamespace, it's a no-op when everything's already been set up for\nus so it doesn't interfere with iPhone, or with a correctly\nestablished namespace.
{html}", "updateAuthor": { "name": "brionvibber", "key": "brionvibber", "displayName": "Brion Vibber", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T02:50:42.000+0000", "updated": "2011-04-15T02:50:42.000+0000" }, { "id": "125492", "author": { "name": "brionvibber", "key": "brionvibber", "displayName": "Brion Vibber", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

That'll be a <script src=\"binding.js\"></script> of\ncourse... formatting ate the tag in post above. :)

{html}", "updateAuthor": { "name": "brionvibber", "key": "brionvibber", "displayName": "Brion Vibber", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T02:50:42.000+0000", "updated": "2011-04-15T02:50:42.000+0000" }, { "id": "125493", "author": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "body": "{html}

dupe #1635 and #2153 and #2514

\n

fixed with this commit to master (1.5.1):
\n\nhttps://github.com/appcelerator/titanium_mobile/commit/12d7bf6a90db...

{html}", "updateAuthor": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "created": "2011-04-15T02:50:43.000+0000", "updated": "2011-04-15T02:50:43.000+0000" }, { "id": "411118", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket as duplicate.", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-03-09T23:47:30.000+0000", "updated": "2017-03-09T23:47:30.000+0000" } ], "maxResults": 5, "total": 5, "startAt": 0 } } }