How can that be, that I get a list of files in Assets, than the exception, that the file does not exist?
(Exception) java.lang.Exception: java.io.FileNotFoundException: /data/user/0/de.cadenzo.klarinette/files/virtual_assets/tonarten_lernen.html (No such file or directory)
(Exception) java.lang.Exception: java.io.FileNotFoundException: /data/user/0/de.cadenzo.klarinette/files/virtual_assets/tonarten_lernen.html (No such file or directory)
B4X:
Sub CopyFromAssets
Dim sMainFolder As String = xui.DefaultFolder
Dim sFolderA As String = File.DirAssets
Dim sFolderB As String = File.Combine(sMainFolder, "data")
If File.Exists(sMainFolder, "data") = False Then File.MakeDir(sMainFolder, "data")
For Each sFile As String In File.ListFiles(sFolderA)
If sFile.EndsWith("html") Then 'Or sFile.EndsWith(".jpg") Then
Try
File.Copy(sFolderA, sFile, sFolderB, sFile)
Catch
Log(sFile)
Log(LastException)
End Try
End If
Next
End Sub