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!
Sub Globals
Dim WebView As WebView
Dim webcount As Int
webcount = 0
End Sub
Sub WebView_OverrideUrl(Url As String) As Boolean
If Url.Length > 0 Then
webcount = webcount + 1
End If
End Sub
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?
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