Opening new android activity with a webview shows a blank (white) screen instead of the html content

前端 未结 11 1493
野性不改
野性不改 2020-12-29 03:29

I have been researching for 2 days and I haven\'t found a similar problem anywhere on the internet!

From the main activity, I\'m trying to open a new activity contai

11条回答
  •  无人及你
    2020-12-29 04:02

    Don't try to load the given url in shouldOverrideUrlLoading, and don't return true from it in your case either. Really, from what it looks like you're trying to do, you shouldn't need to override it at all.

    Returning true from shouldOverrideUrlLoading indicates to the WebView that it should not load the specified URL. What you're doing - telling the WebView to begin loading it again - is likely to cause some sort of internal loop inside the WebView, which I'd guess is why you're seeing odd behavior.

提交回复
热议问题