B4J Question Visible file

moore_it

Well-Known Member
Licensed User
Longtime User
Hi,

how i do for check if a file is visible or not ?

Thanks in advice
 

rwblinn

Well-Known Member
Licensed User
Longtime User
Example using Java API call to check the hidden attribute.

B4X:
'Returns true if the hidden file attribute is set. Requires the Javaobject library.
'Note: If file not found, then false is returned.
'Example <code>:
'Dim f As String = File.DirApp & "\fileishidden.txt"
'Log(f & "=" & FileIsHidden(f))   ' filepath=true</code>
Sub FileIsHidden(Path As String) As Boolean
   Dim fileO As JavaObject
   fileO.InitializeNewInstance("java.io.File", Array As Object(Path))
   Return fileO.RunMethod("isHidden", Null)
End Sub
 
Upvote 0
Top