Android Question Download files inside a webview

Medexpert

Member
Licensed User
Dear Developers,

I use webview to check a webpage where pdf documents ar stored.
The automatic login (with usernname and password) is working well, after I would like to click and download the pdf files. But when I click a pdf file nothing to happend.
I tried to use webview1.OverrideURL event but not succesfull. The Android tried to open the link with default webbrowser, but this gave an error becuse that was not loged in.
I used this:

B4X:
Sub WebView1_OverrideUrl (Url As String) As Boolean
   If Url.indexof(".pdf")>0 OR Url.IndexOf(".doc")>0 OR Url.IndexOf(".docx")>0 Then
        Dim p As PhoneIntents
        StartActivity(p.OpenBrowser(Url))
        Return True
     Else
        Return False
   End If
End Sub
Could you help how can I download a file with webview?
Thanks,
Istvan
 
Top