H holyraf Member Mar 3, 2020 #1 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 Here the code where i create the directory folder: B4X: Copy 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
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 Here the code where i create the directory folder: B4X: Copy 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
Erel B4X founder Staff member Licensed User Longtime User Mar 4, 2020 #2 Never use File.DirDefaultExternal. Runtime Permissions (Android 6.0+ Permissions) Delete folder: https://www.b4x.com/android/forum/threads/b4x-copyfolder-deletefolder.69820/#content Upvote 0
Never use File.DirDefaultExternal. Runtime Permissions (Android 6.0+ Permissions) Delete folder: https://www.b4x.com/android/forum/threads/b4x-copyfolder-deletefolder.69820/#content