calling javascript function from an android activity

后端 未结 7 1767
心在旅途
心在旅途 2021-01-06 01:13

I wan to call a javascript function from an android activity but it doesn\'t seem to work. I have used the android webview function webview.loadUrl(\"javascript:function()\"

相关标签:
7条回答
  • 2021-01-06 01:58

    Try to change this :

    webview.loadUrl("javascript:change(i)");
    

    to this

    webview.loadUrl("javascript:change(" + i +")");
    

    the way you have write it the "i" is not the variable "i" from your java code but just a String named "i".

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