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
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 JSNote 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 anyone confirm that this is indeed failing (newly) on 5.0? And/or suggest a workaround?