I have a webview that wants to retrieve certain String value via a javascript function. I use a JavascriptInterface to print that value. This javascript lives inside a tag in a hosted HTML.
Then, when I call view.loadUrl("javascript:JSInterface.print(myFunction());")
it just doesn't print anything.
However, I noticed that if I take the HTML source code and put it into my project assets and load it from there then the instruction works ok and print the desired value.
Are there any security reasons that disables calling javascript functions when they are loaded from Internet?