0

WebView is not rendering web page. I've passed webView and IWebResourceRequest as parameters to ShouldOverrideUrlLoading and it still doesn't seem to be working. Here's a snippet of my code:

public override bool ShouldOverrideUrlLoading(WebView view, IWebResourceRequest request)
{
var url = request.Url.ToString();


if (url.StartsWith("mailto:"))
{
    Intent intent = new Intent(Intent.ActionSendto, Android.Net.Uri.Parse(url));
    _context.StartActivity(intent);
    view.SetBackgroundColor(Android.Graphics.Color.Gray);
    view.Reload();
    return true;
}
else
    view.LoadUrl(url);
return true;
}

I've tried to use the correct parameters for ShouldOVerrideUrlLoading but it is not worked.

3
  • Did you double-check your url? Have you enabled Javascript? Does your webview handle redirect? There could be several reason for it to not display the page.
    – esQmo_
    Commented Sep 7, 2023 at 10:19
  • Yes, the shouldOverrideUrlLoading handles redirects whenever a new url is about to be loaded with webView. Javascript is also enabled
    – GitGood
    Commented Sep 7, 2023 at 10:40
  • Please put your entire class here, this is very limited information Commented Sep 7, 2023 at 10:45

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.