简体   繁体   English

如何在Android中刷新浏览器页面?

[英]How to refresh the browser page in android?

I am opening the URL by using following Intent. 我通过使用以下Intent打开URL。

Intent browserIntent = new Intent(Intent.ACTION_VIEW,Uri.parse(actionURL));
startActivity(browserIntent);

.first time it loads the page ,in that i might enter the some data.then once again if i try to open the same page,it is trying to display the old page where i entered some data.if i refresh then it is showing the latest page .but my requirement is every time page should refresh automatically? 。第一次加载页面,因为我可能会输入一些数据。然后如果我再次尝试打开同一页面,它将试图显示我输入一些数据的旧页面。如果刷新,则显示最新页面。但是我的要求是每次页面都应该自动刷新吗?

Two scenario can be considered here. 这里可以考虑两种情况。

  • First it is your developed web page getting accessed from "asset" folder. 首先,这是您从“ asset”文件夹访问的已开发网页。
  • Second You are trying to access a website. 其次,您正在尝试访问网站。

1.If it is your web page, you need to write the code in javascript something like this: 1.如果是您的网页,则需要使用javascript编写如下代码:

    function refreshIt(){
      setTimeout('refreshIt()',5000);
    }

2.If you are accessing the website. 2.如果您正在访问该网站。

For this check out browser api: http://developer.android.com/reference/android/provider/Browser.html 对于此签出浏览器api: http : //developer.android.com/reference/android/provider/Browser.html

Try using"deleteFromHistory(ContentResolver cr, String url)" method to clear the history of the particular website, so that when it refreshes it gives you the new page. 尝试使用“ deleteFromHistory(ContentResolver cr,String url)”方法清除特定网站的历史记录,以便刷新时为您提供新页面。

You cannot refresh it from the api level. 您无法从api级别刷新它。

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

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