Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-18969

Android: ActionBar.onHomeIconItemSelected() breaks evalJS() on Android 5.0


    • Type: Bug
    • Status: Open
    • Priority: Critical
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Android
    • Environment:

      Android 5.0, Ti 3.3.0 or 3.4.1


      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?




            • Assignee:
              kt KT
            • Watchers:
              0 Start watching this issue


              • Created:

                Backbone Issue Sync

                • Titanium SDK/CLI <> Titanium Mobile
                  Synced with:
                  Sync status:
                  Last received:
                  Last sent:

                  Git Integration