private void deleteDirectoryRecurse(Context context,File dir){
  if (FileUtils.isDirectory(dir)) {
    for (    File child : dir.listFiles()) {
      deleteDirectoryRecurse(context,child);
    }
  }
  if (dir.exists()) {
    dir.delete();
    FileUtils.updateMediaScanner(context,Uri.fromFile(dir));
  }
}

private void deleteDirectoryRecurse ( Context context , File dir ) { if ( FileUtils . isDirectory ( dir ) ) { for ( File child : dir . listFiles ( ) ) { deleteDirectoryRecurse ( context , child ) ; } } if ( dir . exists ( ) ) { dir . delete ( ) ; FileUtils . updateMediaScanner ( context , Uri . fromFile ( dir ) ) ; } }
delete the directory recursively .
