Italian UltimateWebView2 e i download

LordZenzo

Well-Known Member
Licensed User
Longtime User
qualcuno ha gia usato la nuova versione?
sto migrando una mia app dalla vecchia causa malfunzionamento con le nuove regole di android
funziona tutto, tranne il download di un pdf da una pagina web
ho aggiunto
B4X:
    Private WebView1 As UltimateWebView
    Private web As WebView   ' usato internamente
    Private numero As Int
    Private npagine As Int
    Private Label2 As Label
    Private Panel1 As Panel
    Private downlistner As UltimateDownloadListener
End Sub

'This event will be called once, before the page becomes visible.
Private Sub B4XPage_Created (Root1 As B4XView)
    Root = Root1
    Root.LoadLayout("webzine_number")
    web.Initialize("")
    Label1.text="apri la nostra webzine"
    Panel1.Width=0
    downlistner.Initialize2("downlistner",WebView1)
end sub
Sub downlistner_FileDownloadInitialized (Properties As DownloadProperties) 'Works from API level 1 and above.

    downlistner.StartFileDownload(Properties,"TEST","",True,True)

End Sub

ma non accade nulla
 

Sagenut

Expert
Licensed User
Longtime User
Puoi mettere un esempio minimo completo da testare?
 

LordZenzo

Well-Known Member
Licensed User
Longtime User
Puoi mettere un esempio minimo completo da testare?
dovrei fare un app al completo, anche se basta una UltimateWebView ed un link che contenga un download, il codice si limita a quello del primo post
 

LucaMs

Expert
Licensed User
Longtime User

LordZenzo

Well-Known Member
Licensed User
Longtime User
Ovviamente hai anche una routine evento:
B4X:
Private Sub downlistner_FileDownloadCompleted (Success As Boolean, Properties As DownloadProperties) 'Works from API level 9 and above.
che non scatta, vero?
seguito l'esempio, corretto il codice
l'evento scatta, ma ho notato che scatta mooooooooolto dopo l'effettivo download del file, non esagero dicendo che scatta circa 4/6 minuti dopo
e avvolte non scatta affatto
 
Last edited:
Top