Tks Erel, I'm planning a project to use Webview as the main layout on a site where I can download files.
Curreny converter page on B4a is just a example. I read somewhere, if I click on a download link on webview page, it should open up the default browser, but its not happening on B4a?
Basic4android WebView is the regular native WebView. You can use OverrideUrl event to send an intent and launch the default browser when the user presses on a link. You can also download the file yourself with HttpClient.
Basic4android WebView is the regular native WebView. You can use OverrideUrl event to send an intent and launch the default browser when the user presses on a link. You can also download the file yourself with HttpClient.
Sub WebView1_OverrideUrl (Url As String) As Boolean
'Test whether this Url points to a file.
'For example:
If Url.EndsWith(".pdf") Then
Dim p As PhoneIntents
Dim i As Intent
i.Initialize(p.OpenBrowser(Url)
Return True
Else
Return False 'let WebView process the Url
End If
End Sub
Sub WebView1_OverrideUrl (Url As String) As Boolean
'Test whether this Url points to a file.
'For example:
If Url.EndsWith(".pdf") Then
Dim p As PhoneIntents
Dim i As Intent
i.Initialize(p.OpenBrowser(Url)
Return True
Else
Return False 'let WebView process the Url
End If
End Sub