Here, FileName is the name of the file you want to delete, and without the path separator. This means that FileName should not contain a path separator, such as "/". The file must be created by your application. My problem was resolved by this code.
if(getApplicationContext().deleteFile(FileName)) { Toast.makeText(getApplicationContext(),"File Deleted",Toast.LENGTH_SHORT).show(); } else { Toast.makeText(getApplicationContext(),"Not Deleted",Toast.LENGTH_SHORT).show(); }
SNDM
source share