A simple code for testing File.Dir. it works well in phone, but in TvSet it does not work.
code is following
logs
It seems not have permission to read filedir
code is following
B4X:
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("Layout")
Dim rp As RuntimePermissions
Dim folder As String
folder = rp.GetSafeDirDefaultExternal("")
Log(folder)
Log(File.ListFiles(folder))
Log(File.DirRootExternal)
Log(File.ListFiles(File.DirRootExternal))
Dim jo As JavaObject
jo.InitializeNewInstance("java.io.File", Array(File.Combine(File.DirRootExternal, "/")))
Dim CanonicalPath As String = jo.RunMethod("getCanonicalPath", Null)
Log(CanonicalPath)
Log(File.ListFiles(CanonicalPath))
End Sub
logs
B4X:
** Activity (main) Create, isFirst = true **
/storage/emulated/0/Android/data/b4a.example/files
(List) Not initialized
/storage/emulated/0
(List) Not initialized
/storage/emulated/0
(List) Not initialized
** Activity (main) Resume **
It seems not have permission to read filedir