Android Question Delete file - weird behavior

mmucek

Member
Licensed User
Longtime User
I use this code to delete image:

B4X:
Dim picDir As String = File.DirRootExternal
Log(File.Delete(picDir, "test.jpg"))

Delete returns true, file is not deleted but damaged. Same behavior Android 5 & 7.
Double click on file in Windows File Explorer returns error:
"Windows Photo Viewer can't open this picture because the file appears to be damaged, corrupted or too large."
 

JordiCP

Expert
Licensed User
Longtime User
I use this code to delete image:

B4X:
Dim picDir As String = File.DirRootExternal
Log(File.Delete(picDir, "test.jpg"))

Delete returns true, file is not deleted but damaged. Same behavior Android 5 & 7.
Double click on file in Windows File Explorer returns error:
"Windows Photo Viewer can't open this picture because the file appears to be damaged, corrupted or too large."

Possibly the file has been deleted but the system isn't yet aware of this.

If this is the case, you could try THIS
 
Upvote 0
Top