Android Question Delete files and use wait for

alimanam3386

Active Member
Licensed User
Longtime User
Hi guys

How can I use wait for in bellow function ( delete files function )

B4X:
Sub DeleteAll_FilesInFolder(iPathFolder As String) As String
    Dim MyList As List
    MyList.Initialize
    Dim sd As String
    Dim MyFile As String
    MyList = File.ListFiles(iPathFolder)
    If MyList.Size > 0 Then
        For i= MyList.Size-1 To 0 Step -1
            MyFile = MyList.Get(i)
            File.Delete(iPathFolder,MyFile)
            sd = (iPathFolder & MyFile)
            LogColor(sd & " [removed]",Colors.Yellow)
        Next
        Return "SUCCESS"
    Else
        Return "FILESNOTFOUND"
    End If
End Sub
 

DonManfred

Expert
Licensed User
Longtime User
Upvote 0
Top