I'm getting the error "no method with name = 'evaluateJavascript' in Landroid/webkit/Webiew" on Android 4.3
this is what i'm doing in my WebViewClient:
public override bool ShouldOverrideUrlLoading (WebView view, string url)
{
if(url.Contains ("addsResponseLoaded"))
{
view.EvaluateJavascript ("window.giveMeMyResponse();", controller.JSResultObj);
//view.StopLoading ();
return false;
}
return true;
}
This happens only on older version of android and specific devices like the htc and galaxy. How can i get the return value of a javascript function android older versions than android kitkat?
A simple look at developer page
Your minSdkVersion should be at least 19 for this method to work.
If you need to evaluate JavaScript on earlier versions of Android (3+), here is a little library:
https://github.com/evgenyneu/js-evaluator-for-android