How does evaluateJavascript work?

后端 未结 6 828
执念已碎
执念已碎 2020-11-27 03:06

I\'m trying to use the new evaluateJavascript method in Android 4.4, but all I ever get back is a null result:

webView1.evaluateJavascript(\"return \\\"test\         


        
6条回答
  •  自闭症患者
    2020-11-27 03:28

    Important hint:
    Before calling evaluateJavascript you have to enable JavaScript for your WebView. Otherwise you get no result.

    WebSettings settings = yourWebview.getSettings();
    settings.setJavaScriptEnabled(true);
    

提交回复
热议问题