Android Question How to delete a folder

holyraf

Member
Hi how can i delete a folder when i press back or a confirmation. Anyways here is what i want to do:

1. A button press will create a folder in fileDirdefaultexternal
2. when the user presses back or leave the module. the created folder will be deleted

Thankyou so much :D

Here the code where i create the directory folder:

B4X:
Sub CreateAID
    RCPath = File.DirDefaultExternal & "/" & rando & "/"
    If File.Exists(RCPath,"") Then
        Dim rando As Int = Rnd(0,150000)
        Activity.Finish
        StartActivity(Me)
    Else
        File.MakeDir(RCPath,rando)
    End If
End Sub
 
Top