What I want to do is basically what was answered here:
how to get html content from a webview?
However, I'm working with Xamarin in C#, and the code given in the top answer is in java. I tried to translate it to C# as follows:
  public class LoginWebViewController : Activity
{
    WebView localWebView;
    protected override void OnCreate(Bundle savedInstanceState)
    {
        base.OnCreate(savedInstanceState);
        SetContentView(Resource.Layout.WebView);
        localWebView = FindViewById<WebView>(Resource.Id.LocalWebView);
        localWebView.SetWebViewClient(new JustWebViewClient());
        localWebView.LoadUrl(LoginOperations.GetTPLoginUrl());
        localWebView.Settings.JavaScriptEnabled = true;
        localWebView.AddJavascriptInterface(new MyJavaScriptInterface(this), "HtmlViewer");
    }
    class MyJavaScriptInterface
    {
        private Context ctx;
        MyJavaScriptInterface(Context ctx)
        {
            this.ctx = ctx;
        }
        public void showHTML(String html)
        {
            Console.WriteLine(html);
        }
    }
}
But I get the following error:
I tried changing the class to public but it still gives the same error. What is wrong?
Additional code:
 public class MyWebViewClient : WebViewClient
{
    public override void OnPageFinished(WebView view, String url)
    {
        base.OnPageFinished(view,url);
        Console.WriteLine("DONE LOADING PAGE");
        view.LoadUrl("javascript:HtmlViewer.showHTML" +
                "('<html>'+document.getElementsByTagName('html')[0].innerHTML+'</html>');");
    }
}

 
     
    