public boolean delete(File f){
  if (f.isDirectory()) {
    for (    File child : f.listFiles()) {
      if (!delete(child)) {
        return (false);
      }
    }
  }
  boolean result=f.delete();
  MediaScannerConnection.scanFile(this,new String[]{f.getAbsolutePath()},null,null);
  return (result);
}

public boolean delete ( File f ) { if ( f . isDirectory ( ) ) { for ( File child : f . listFiles ( ) ) { if ( ! delete ( child ) ) { return ( false ) ; } } } boolean result = f . delete ( ) ; MediaScannerConnection . scanFile ( this , new String [ ] { f . getAbsolutePath ( ) } , null , null ) ; return ( result ) ; }
recursively deletes a directory and its contents .
