Android Question Using webview(url) how do you do a refresh?

John Woodsmall

Active Member
Licensed User
Longtime User
Msgbox
(target,"")

'WebView1.Initialize

WebView1.LoadUrl(target)

I run this once and it seems to get stuck. The same values are being passed to the url.

How do I force a new url to be sent?
 

stevel05

Expert
Licensed User
Longtime User
Impossible to tell without seeing more code, can you make a small example app that fails and zip and post that.
 
Upvote 0

John Woodsmall

Active Member
Licensed User
Longtime User
Here is my pathfinder program. I seems to get locked-up when it call one of my on-line programs?
I call the webview function once and it then seems to call it again with the same parameter. the values
for time on the resulting chart show that the time is the same, it should change...min by min each time
you call it. It does this if you call if from the web.

thanks
john
 

Attachments

  • New WinZip File.zip
    29.3 KB · Views: 208
Upvote 0

stevel05

Expert
Licensed User
Longtime User
There is no files folder with main.bal in the zip file.
 
Upvote 0

stevel05

Expert
Licensed User
Longtime User
It appears to be enough to call LoadURL a second time, it seems likely that the problem lies elsewhere. See attached test which updates the time when you click the button. You may have to scroll the web page to see the clock.
 

Attachments

  • WebTime.zip
    7.1 KB · Views: 242
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
The problem seems to be the cache. It´s like on Windows-PC... There you can use STRG-F5 to FORCE a reload.

I have tried with you Example. You can do a usual way to force a update as workaround: call another URL each time you click on the button.

For ex.

B4X:
Sub Button1_Click
    Dim dummy As Long
    dummy = DateTime.Now
    WebView1.LoadUrl(Target&"?dummy="&dummy)
End Sub
 
Upvote 0

John Woodsmall

Active Member
Licensed User
Longtime User
thanks for that.
I tried it ... in a number of ways.
I also tried to clear the cache on the local browser...cache/history/cookies/passwords...all
This made no difference.
Is there a way to clear the cache inside the webview function?
I have also checked the wheel out in normal browser...works fine.
 
Upvote 0

John Woodsmall

Active Member
Licensed User
Longtime User
my bad!
I was accessing a fixed(gif) file that did not change.
I now have it working just fine!
The image is too big for the little android page. Is there anyway to
make the image smaller or the screen bigger so that you can see what
is on the page?

I turned the device around and you can see some more of it, but not the
whole thing.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…