I am creating a file to send as an attachment to an email. Now I want to delete the image after sending the email. Is there a way to delete the file?
I have tried
File file = new File(selectedFilePath); boolean deleted = file.delete();
where selectedFilePath is the path of the file you want to delete - for example: