[英]WebView component gives an error (Webpage not available) when navigating to a page whose URL begins with something other than http:// or https://
我需要做的就是調用 shouldOverrideUrlLoading() 如下:
public boolean shouldOverrideUrlLoading(WebView view, WebResourceRequest request) {
Uri current_page = request.getUrl();
if (!current_page.toString().startsWith(("http://")) && !current_page.toString().startsWith(("https://"))) return true;
return false;
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.