Count the number of links pressed in a webview

sarim123

Member
Licensed User
Longtime User
Does anyone know how to count the number of links that are pressed in a Webview? I searched everywhere and i cant find an answer. I also would need help displaying the number. Thanks Everyone!

--Sarim
 

sarim123

Member
Licensed User
Longtime User
Error

I am getting an error that says...

An error has occured in
sub:webview_activity_create (java
line: 235)
java.lang.RuntimeException:
java.lang.RuntimeException: Field
webcount was declared with the
wrong type.
Continue?

Thanks for your help
 
Upvote 0

sarim123

Member
Licensed User
Longtime User
Here

I think the issue is that i called put a label in the designer called webcount. How can i view the number?

B4X:
'Activity module
Sub Process_Globals


End Sub

Sub Globals

   Dim WebView1 As WebView
    Dim webcount As Int
    webcount = 0
End Sub

Sub Activity_Create(FirstTime As Boolean)
   
   Activity.LoadLayout("Webview")
   WebView1.LoadURL("http://www.google.com")
End Sub

Sub Activity_Resume

End Sub

Sub Activity_Pause (UserClosed As Boolean)

End Sub

Sub WebView_OverrideUrl(Url As String) As Boolean
    If Url.Length > 0 Then
        webcount = webcount + 1
    End If
End Sub

Can u please help
Thanks!
 

Attachments

  • webviewtest1.zip
    6.9 KB · Views: 170
Upvote 0
Top