Webview Showing Blank White Page On Android?

Hi All,

I'm currently in a struggle with loading web pages on a web view on my Android devices. I used to have the same problem on iOS until I added the necessary permission in info.plist (Allow Arbitrary Loads = True).

For Android I have the "Internet" permission checked in the manifest but still with no luck with showing any web pages. And as I debug in OnAppearing I see that the (webview.source.url) has the correct path but I still see nothing.

Btw my backend services are currently returning only http urls. Can this be the cause for the webview's inability to load in Android without having a similar loadArbitraryLoads permission ?

P.S, on iOS the webview would only load the web pages if the call to set the source is placed directly after InitializeComponent() as below. If I try to move the line after InitializeComponent() any further below it won't have any effect no matter what and show a blank white page instead. So then I have to either make another constructor as below or share the url across a static public property for the page to access right after initializing views.

public Page(string url)
        {
            InitializeComponent();
            webView.Source = url;
            initPage();
        }
Tagged:

Best Answer

  • AhmedElashkerAhmedElashker USMember ✭✭
    Accepted Answer

    So to follow up in case anyone else had this case.

    I was testing an attachment's url. The url was being loaded successfully into the webview, but the difference between iOS and Android is the default behaviours for handling attachment urls. In iOS it opens up in the browser while in Android the default behaviour is to download, hence why it's not opening in the webview.

Answers

  • AhmedElashkerAhmedElashker USMember ✭✭
    Accepted Answer

    So to follow up in case anyone else had this case.

    I was testing an attachment's url. The url was being loaded successfully into the webview, but the difference between iOS and Android is the default behaviours for handling attachment urls. In iOS it opens up in the browser while in Android the default behaviour is to download, hence why it's not opening in the webview.

Sign In or Register to comment.