Reputation: 6341
Wrote some renderer for Android webView. Tryin' to call some javascript like this:
if (Build.VERSION.SdkInt >= BuildVersionCodes.Kitkat)
{
this.Control.EvaluateJavascript(@"javascript: alert('asdasd');", new ValueCallback(() => { }));
}
else
{
this.Control.LoadUrl(@"javascript:alert('asdasd');");
}
Before it I setted
this.Control.Settings.JavaScriptEnabled = true;
And there is no reaction. I can't see neither alert no any action in ValueCallback class. What I'm doing wrong?
Upvotes: 5
Views: 2294
Reputation: 1161
add this :
Control.SetWebChromeClient(new WebChromeClient());
it'll work.
Upvotes: 2