With this rather standard code (taken from web examples here)
Dim fd As FileDialog
Dim ret As Int
fd.FastScroll = True
fd.FilePath = File.DirAssets
fd.FileFilter = ".txt"
fd.ChosenName = "5-a1.txt"
ret = fd.Show("Choose a file to load:", "Okay", "Cancel", "", Null)
If ret = -3 OR fd.ChosenName = "" Then
Return
End If
If File.Exists(File.DirAssets, fd.ChosenName) = False Then
Msgbox(fd.ChosenName & " does not exist.", "")
Return
End If
I receive an error
java.lang.RuntimeException: Path 'AssetsDir'does not exist
at ...$FileDialog.loadFileList(InputDialog.java:1758)
at ...$FileDialog.Show(InputDialog.java:1808)
I have already verified that my files have been added to the files tab and that they are present in the .apk in a directory "/assets", together with the screen layout (.bal) file.
When I look at the paths in the File Object, they are set as follows:
File.DirInternal = "/data/data/com.mwettach.voktrainer/files"
File.DirDefaultExternal = "/mnt/sdcard/Android/data/com.mwettach.voktrainer/files"
File.DirAssets = "AssetsDir"
File.DirRootExternal = "/mnt/sdcard/"
The testing device is a 7 inch tablet running Android ICS. I am under the impression that the class variable File.DirAssets is not set correctly, for it does not look like a real path - or am I missing something?
Dim fd As FileDialog
Dim ret As Int
fd.FastScroll = True
fd.FilePath = File.DirAssets
fd.FileFilter = ".txt"
fd.ChosenName = "5-a1.txt"
ret = fd.Show("Choose a file to load:", "Okay", "Cancel", "", Null)
If ret = -3 OR fd.ChosenName = "" Then
Return
End If
If File.Exists(File.DirAssets, fd.ChosenName) = False Then
Msgbox(fd.ChosenName & " does not exist.", "")
Return
End If
I receive an error
java.lang.RuntimeException: Path 'AssetsDir'does not exist
at ...$FileDialog.loadFileList(InputDialog.java:1758)
at ...$FileDialog.Show(InputDialog.java:1808)
I have already verified that my files have been added to the files tab and that they are present in the .apk in a directory "/assets", together with the screen layout (.bal) file.
When I look at the paths in the File Object, they are set as follows:
File.DirInternal = "/data/data/com.mwettach.voktrainer/files"
File.DirDefaultExternal = "/mnt/sdcard/Android/data/com.mwettach.voktrainer/files"
File.DirAssets = "AssetsDir"
File.DirRootExternal = "/mnt/sdcard/"
The testing device is a 7 inch tablet running Android ICS. I am under the impression that the class variable File.DirAssets is not set correctly, for it does not look like a real path - or am I missing something?