You can delete any file or dir by this method:
File f = new File("your path");
f.delete();
and don't forget to add permission in menifest
and above version 6.0 you need to give runtime permission like this:
final String[] NECESSARY_PERMISSIONS = new String[] {Manifest.permission.WRITE_EXTERNAL_STORAGE};
if ((ContextCompat.checkSelfPermission(getApplicationContext(),
Manifest.permission.WRITE_EXTERNAL_STORAGE) == PackageManager.PERMISSION_GRANTED)) {
{
//Permission granted.
}
else
{
// Request for permission
ActivityCompat.requestPermissions(getApplicationContext(),
NECESSARY_PERMISSIONS, 123);
}