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

joop

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

Html file

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

B4a Code

B4X:
Sub WebView1_OverrideUrl(Url As String) As 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 .
 

joop

Active Member
Licensed User
Longtime 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.
 
Upvote 0
Top