johnnyontheweb
Member
Hi all, I have a simple app displaying a website through Webview control. However I noticed that file upload and download are not permitted - nothing happens when the site return a file or when a file upload dialog is requested.
How to add these functionalities? Thanks in advance
How to add these functionalities? Thanks in advance
B4X:
Sub Globals
'These global variables will be redeclared each time the activity is created.
Private mainW As WebView
Dim wextr As WebViewExtras
Dim wsett As WebViewSettings
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("Layout")
toggleFormLogout
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub toggleFormLogout
mainW.Initialize("mainW")
wsett.setAllowFileAccess(mainW,True)
wextr.addJavascriptInterface(mainW,"jsEv")
wextr.addWebChromeClient(mainW,"chromeEv")
Activity.AddView(mainW, 0, 0, 100%x, 100%y)
mainW.LoadUrl("https://mysite.com")
End Sub