1. *** New version of B4J is available ***
    B4J v7.8
    Dismiss Notice

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

Discussion in 'Android Questions' started by Francisco Gonzalez 1962, Aug 23, 2019.

  1. Francisco Gonzalez 1962

    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: Aug 23, 2019
  2. DonManfred

    DonManfred Expert Licensed User

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

    Code:
    sub webview_OverrideUrl (Url As StringAs Boolean
     
    Dim pi As PhoneIntents
        
    Log("Value: " & Url) '
         StartActivity(pi.OpenBrowser(Url))
         
    return true ' or false; you need to test
    end sub
     
    Erel and Francisco Gonzalez 1962 like this.
  3. Francisco Gonzalez 1962

    Francisco Gonzalez 1962 Member Licensed User

    Yes... It works like a charm.

    Thanks.

    Francisco
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice