B4J Question view file pdf into webview

ivanomonti

Expert
Licensed User
Longtime User
it should be simple but as usual something goes wrong :-(

B4X:
    Dim fc As FileChooser
    Dim fileSelected As String            'File selected. If selected full path is returned else ""
    fc.Initialize                       'Init! Do not forget
    fc.InitialDirectory = File.DirApp   'Set starting folder
    fc.Title = "Select a File"
    fileSelected = fc.ShowOpen(MainForm)      'Show the dialog and select
    If fileSelected.Length > 0 Then
        SetFieldValue(fileSelected)
        WebView1.LoadUrl("file:///" & fileSelected.Replace(" ","%20").Replace("\","/"))
    End If
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…