Any method in xamarin forms equivalent to ShouldOverrideUrlLoading method of android?

Any method in xamarin forms equivalent to shouldoverride method of android?

I am looking for a method that I can call when a button is clicked on webview. this is the android sample code that is working.

        webView.Settings.JavaScriptEnabled = true;
        webView.SetWebViewClient(new HybridWebViewClient(this));
        webView.Settings.DomStorageEnabled = true;

on HybridWebViewClient class

public override bool ShouldOverrideUrlLoading(WebView view, string url)
{
}

Solution 1:

  1. Xamarin.Forms is a platform that integrates Android and iOS and Windows. For platform-specific features, you can use Custom renderer to call code on Android platform.

    For details you can refer to: What is Xamarin.Forms and Custom renderer.

  2. Using the OnPageStarted method, the OnPageFinished method, and the OnReceivedError method is also a good choice.

    Details can be found in the answer at this link:Xamarin.Forms ShouldOverrideUrlLoading Trigger