Android Question how to signal leaving an app and visiting website ?

Discussion in 'Android Questions' started by joop, Apr 2, 2015.

  1. joop

    joop Active Member Licensed User

    Hi , I want to show a message when the user clicks on a website wich is coded with a html file

    Html file

    Code:
    <a href="https://www.flickr.com/"target="_blank">pictures </a>
    B4a Code

    Code:
    Sub WebView1_OverrideUrl(Url As StringAs Boolean

    Dim linkpart1,linkpart2,linkpart3,linkpart4  As String                            

     
    'This SUB will grab the link the user clicked on and save it in URL
    'file:///android_asset/sample.mp3'
    ' do something to show mp3 
    If Url.EndsWith("mp3"Then
       
    ' code
       return True 
    End If


       
    'File:///android_asset/koe.jpg
       '<img src="file:///android_asset/koe.png"/>
       If Url.EndsWith("jpg"Then
          
    'code
          Return True
        
    End If

    Msgbox("This link opens your webbrowser. You will leave the app","")

    end sub
    The sub grabs the link and looks for jpg and mp3 this works fine
    When the flickr link is pressed , the Msgbox = shown but it's
    shown twice , also when the user clicks a link on the flickr site
    the Msgbox is shown.

    Is it possible to show the Msgbox once ,and only when you leave
    the app .
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    Where is the code that leaves the app?
     
  3. joop

    joop Active Member Licensed User

    Oh you're right, the code doesn't leaves the app , but I want to signal to the user
    that the content he gets from the opened web-page doesn't belongs to the app.
     
  4. Erel

    Erel Administrator Staff Member Licensed User

    Check the value of Url. Maybe there is a redirection somewhere that causes two urls to be loaded.
     
  5. joop

    joop Active Member Licensed User

    Thanks, I will check it.
     
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