I have included several files in the project Files tab and can see them with:
But If I try to use the dialog it gives me an error indicating the directory does not exist.
Yet, I can open the file if I hardcode it as follows:
What am I doing wrong?
B4X:
Log(File.ListFiles(File.DirAssets ))
But If I try to use the dialog it gives me an error indicating the directory does not exist.
B4X:
Dim fd As FileDialog
Dim ret As Int
fd.FastScroll = True
fd.FilePath = File.DirAssets
fd.FileFilter = ".*"
ret=fd.Show ("Select File to Load","","","",Null )
Yet, I can open the file if I hardcode it as follows:
B4X:
Dim In As InputStream
Dim FileToProcess As String
FileToProcess=File.DirAssets & "/" & 'baseconfiiguration.xml"
If File.Exists (File.DirAssets, 'baseconfiiguration.xml") Then
In = File.OpenInput(File.DirAssets, 'baseconfiiguration.xml")
'do something with the file
Else
ToastMessageShow(FileToProcess & " DOES NOT EXIST", True)
End If
What am I doing wrong?