Android Question webview links to open in safari

cengolo

Member
Licensed User
Longtime User
Hi,

I am developing a wrapper app which only contains a webview and loads the pages from my server. I want some of the links to open in Safari, not inside the webview (kind of target=_blank). How can I do it? Do I need to alter the code, or alter the HTML markup?


Best

cenk
 

KZero

Active Member
Licensed User
Longtime User
select Phone library from Libs tab and try this code

B4X:
Sub WebView1_OverrideUrl (Url As String) As Boolean
If Url="http://www.google.com" Then
    Dim p As PhoneIntents
    StartActivity(p.OpenBrowser(Url))
    Return True
End If
End Sub
 
Upvote 0
Top