Android Question update a webpage

ringmyr

Member
Licensed User
Longtime User
hi
how i do to check if the webpage in webview is update?
i want it to check about 1 min interval.
 
hi
how i do to check if the webpage in webview is update?
i want it to check about 1 min interval.

When webview finish loading web page fires _PageFinished

Code: Copy
Sub WebView_PageFinished (StrUrl As String)
   'Page is loaded
   'Your code here 
   .../...
 
End Sub

Also you can create a global boolean,
initilize value before load web page,
load value in _PageFinished
and check value in timer1_tick

Code: Copy
Sub Process_Globals
  Dim WebIsLoaded as Boolean=False
  ../..
End Sub

Sub WebView_PageFinished (StrUrl As String)
   'Page is loaded
   'Your code here 
   WebIsLoaded=true
 
End Sub

Sub Timer1_tick
   Timer1.enabled=False
   If WebIsLoaded=True then
      'Your code here
   else
     'do nothing ... or... increase progressbar value?
   end if
   Timer1.enabled=True
End Sub
 
Upvote 0
When webview finish loading web page fires _PageFinished

Code: Copy
Sub WebView_PageFinished (StrUrl As String)
   'Page is loaded
   'Your code here
   .../...

End Sub

Also you can create a global boolean,
initilize value before load web page,
load value in _PageFinished
and check value in timer1_tick

Code: Copy
Sub Process_Globals
  Dim WebIsLoaded as Boolean=False
  ../..
End Sub

Sub WebView_PageFinished (StrUrl As String)
   'Page is loaded
   'Your code here
   WebIsLoaded=true

End Sub

Sub Timer1_tick
   Timer1.enabled=False
   If WebIsLoaded=True then
      'Your code here
   else
     'do nothing ... or... increase progressbar value?
   end if
   Timer1.enabled=True
End Sub

If you want to refresh web page each x time... here is an example.
To avoid blank page while refreshing web page i put two webview
then user see last updated web page while app loads in background the
other webview.

Press hand to load page
Long press to start auto refresh.
Long press again to stop auto refresh.

Libraries: Httputils2
 

Attachments

Upvote 0
Back
Top