Android Question webview displays local html file and clicking the links in the file opens default navigator [Solved]

Francisco Gonzalez 1962

Member
Licensed User
Hello, I have a local file being displayed in webview, so far so good. But when the user clicks the links (urls) in the file, webview navigates to the link destination. I want that the default browser opens and navigates to the link destination. Is that possible?

Cheers
Francisco
 
Last edited:

DonManfred

Expert
Licensed User
Longtime User
use the override url event (don´t know the exact name), catch the URL and open it with the device default browser.

B4X:
sub webview_OverrideUrl (Url As String) As Boolean
 Dim pi As PhoneIntents
    Log("Value: " & Url) '
     StartActivity(pi.OpenBrowser(Url))
     return true ' or false; you need to test
end sub
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…