passing data to javascript in webview before android level 17 (4.2.2)

前端 未结 1 1057
北荒
北荒 2021-01-24 15:47

I am working on some charting library in javascript that call from android.

Understand that JavascriptInterface only available after Android API Level 17 (4.2.2)

相关标签:
1条回答
  • 2021-01-24 16:08

    Understand that JavascriptInterface only available after Android API Level 17 (4.2.2)

    addJavascriptInterface() has been around since API Level 1. What you are linking to is the @JavascriptInterface annotation, which has only been around since API Level 17. Neither of these things have anything to do with your problem.

    is there anyway to pass a json to javascript?

    On API Level 19+, use evaluateJavascript(). On API Level 18 and below, use loadUrl("javascript:"), using the same basic syntax used for bookmarklets on desktop browsers.

    0 讨论(0)
提交回复
热议问题