Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-18969] Android: ActionBar.onHomeIconItemSelected() breaks evalJS() on Android 5.0

GitHub Issuen/a
TypeBug
PriorityCritical
StatusOpen
ResolutionUnresolved
Affected Version/sn/a
Fix Version/sn/a
ComponentsAndroid
Labelsactionbar, android, evaljs, lollipop, timeout
ReporterKT
AssigneeUnknown
Created2014-11-22T00:48:48.000+0000
Updated2018-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?

Comments

No comments

JSON Source