[AC-1865] Android: Ti.App.addEventListener doesn't work inside a WebView under SDK 3.0
| GitHub Issue | n/a |
|---|---|
| Type | Bug |
| Priority | n/a |
| Status | Closed |
| Resolution | Needs more info |
| Resolution Date | 2013-04-04T23:46:07.000+0000 |
| Affected Version/s | n/a |
| Fix Version/s | n/a |
| Components | Titanium SDK & CLI |
| Labels | regression |
| Reporter | Mark Burggraf |
| Assignee | Mauro Parra-Miranda |
| Created | 2012-12-15T21:47:20.000+0000 |
| Updated | 2016-03-08T07:40:46.000+0000 |
Description
Under SDK 2.14, it was possible to trap App-level events inside a webview's javascript block by using Ti.App.addEventListener(). Under 3.0, this no longer seems to work.
An easy workaround is to create a function inside the webview, then put the Ti.App.addEventListener code to the javascript module that hosts the webview. Then execute the function inside the webview using webview.evalJS('myfunction()');
Could you upload a sample project that demonstrates the issue? Also, check the latest 3.1 SDK