Android Question WebView & Action

ViNaTa

Member
I Want a code like
WebView:
Dim domain As String = "https://google.com"
         WebView1.LoadUrl(domain)
if WebView1.Url = "https://b4x.com" then

'Do the Action

End If

Means if in google he open b4x.com then some action start
I Don't know how I write it to its work pls help me:)
 

JohnC

Expert
Licensed User
Longtime User
You would have event code like this that would run when the user clicks a link that goes to b4x.com:

B4X:
Sub Webview1_OverrideUrl (URL As String) As Boolean

    If URL.ToUpperCase = "HTTPS://B4X.COM" Then
        'do action
    End If

    Return False    'flag so that webview1 will still display the webpage

End Sub
 
Upvote 0

ViNaTa

Member
It's work but
B4X:
 If URL.ToUpperCase = "HTTPS://B4X.COM" Then
Not Work I use
B4X:
 If URL = "HTTPS://B4X.COM" Then
And it's work thanks:))
 
Upvote 0
Top