I am having problems with loading javascript functions, which are in external file, into webview in Android Kitkat. My approach for earlier versions was that i implemented my own webview client and in method onPageFinisned i called
mWebView.loadUrl("javascript:" + functions);
later, when i wanted to call some js method, i call same code, like
mWebView.loadUrl("javascript:" + someFunction);
In android kitkat there is new method evaluateJavascript, which replaces my code with calling that javascript functions. My problem is that now this and old approach throw this error:
Uncaught ReferenceError: function is not defined
It seems that problem is in loading that javascript functions to webview but i dont know how to load it other way. Thanks