There is a webview in Android, the page is loaded into it, but without executing a specific script. How to run a script in a loaded page from an application, for example, when processing a button click.
1 answer
I understand that we are talking about using javascript. To do this, enable the execution of javascript in WebView.
WebView myWebView = (WebView) findViewById(R.id.webview); WebSettings webSettings = myWebView.getSettings(); webSettings.setJavaScriptEnabled(true); If you need to do this only by pressing the button, then you can reload the page after pressing the button, having previously enabled the execution of javascript.
|