简体   繁体   中英

How to refresh the browser page in android?

I am opening the URL by using following Intent.

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.
  • 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:

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

2.If you are accessing the website.

For this check out browser 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.

You cannot refresh it from the api level.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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