public static boolean deletePhoto(Uri fileUri){
  try {
    File mediaStorageDir=getMediaStorageDir();
    if (!mediaStorageDir.exists())     return false;
    File photoToDelete=new File(fileUri.getPath());
    return photoToDelete.delete();
  }
 catch (  Exception e) {
    Log.e(TAG,"Failed to delete image!");
    Log.e(TAG,e.getLocalizedMessage());
    return false;
  }
}

public static boolean deletePhoto ( Uri fileUri ) { try { File mediaStorageDir = getMediaStorageDir ( ) ; if ( ! mediaStorageDir . exists ( ) ) return false ; File photoToDelete = new File ( fileUri . getPath ( ) ) ; return photoToDelete . delete ( ) ; } catch ( Exception e ) { Log . e ( TAG , "Failed to delete image!" ) ; Log . e ( TAG , e . getLocalizedMessage ( ) ) ; return false ; } }
deletes a photo that given by uri and returns its result as boolean .
