[TIMOB-18969] Android: ActionBar.onHomeIconItemSelected() breaks evalJS() on Android 5.0
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Critical |
Status | Open |
Resolution | Unresolved |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | Android |
Labels | actionbar, android, evaljs, lollipop, timeout |
Reporter | KT |
Assignee | Unknown |
Created | 2014-11-22T00:48:48.000+0000 |
Updated | 2018-02-28T19:55:37.000+0000 |
Description
Unless I'm just plain doing something wrong, something is broken on 5.0 (using Ti 3.3.0 or 3.4.1 — doesn't matter which.)
What I need to do is, after the home/back button is tapped on the ActionBar, have the app call into the WebView's JS code. But it seems that on Android 5.0, any evalJS() after onHomeIconItemSelected() is called will result in a timeout.
app.js, test.html, and test.js: http://pastebin.com/HCGXjEsY
Works on Android 4.4; subsequently broken on a device just upgraded to 5.0.
On Android 4.4, the output is the expected result:
[INFO] : 'mytest'
[INFO] : doTest()
But on Android 5.0, the output is:
[INFO] : 'mytest'
[WARN] : TiWebViewBinding: (KrollRuntimeThread) [50477,50477] Timeout waiting to evaluate JS
Note that doing it as an event isn't necessary to cause the timeout; I'm doing that because it caused other problems previously, so the way to overcome any context-related issues seemed to be to let the app handle it not in a UI callback. Replacing win.fireEvent('mytest') with view.evalJS('doTest()') directly makes no difference — the evalJS() call still times out.
Can this be confirmed as indeed failing (newly) on 5.0? And if so is there a known workaround?
No comments