简体   繁体   English

关闭外部页面后刷新Android Webview

[英]Refresh Android webview after closing external page

Im using Android webview to load a website. 我正在使用Android Webview加载网站。 And for some reasons I wanted to show some external URL off the webview. 出于某些原因,我想从Web视图中显示一些外部URL。 That is, when user click on a link ( link is in the webview ) a new page will open in the default web browser. 也就是说,当用户单击链接(链接在Web视图中)时,将在默认Web浏览器中打开一个新页面。 This part is working. 这部分正在工作。

Now I wanted to refresh the webview after user close this external page running outside webview. 现在,我想在用户关闭在Webview外部运行的外部页面后刷新WebView。

This can be done, If we running both pages ( parent and external page ) running in browser. 如果我们同时在浏览器中运行页面(父页面和外部页面),则可以完成此操作。 Following code is working for this scenario 以下代码适用于这种情况

    $('#closeButton').click(function () {
        window.opener.location.reload();
        window.close();
    }); 

Above "window.opener.location.reload()" is not reloading Android webview. “ window.opener.location.reload()”上方没有重新加载Android Webview。

Is there are any solution for this ? 有什么解决办法吗?

You may know but the only solution is : mWebView.reload(); 您可能知道,但是唯一的解决方案是: mWebView.reload(); for android 对于Android

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM