public static boolean cancelPotentialWork(Object data,ImageView imageView){
  final BitmapWorkerTask bitmapWorkerTask=getBitmapWorkerTask(imageView);
  if (bitmapWorkerTask != null) {
    final Object bitmapData=bitmapWorkerTask.mData;
    if (bitmapData == null || !bitmapData.equals(data)) {
      bitmapWorkerTask.cancel(true);
      if (BuildConfig.DEBUG) {
        Log.d(TAG,"cancelPotentialWork - cancelled work for " + data);
      }
    }
 else {
      return false;
    }
  }
  return true;
}

public static boolean cancelPotentialWork ( Object data , ImageView imageView ) { final BitmapWorkerTask bitmapWorkerTask = getBitmapWorkerTask ( imageView ) ; if ( bitmapWorkerTask != null ) { final Object bitmapData = bitmapWorkerTask . mData ; if ( bitmapData == null || ! bitmapData . equals ( data ) ) { bitmapWorkerTask . cancel ( true ) ; if ( BuildConfig . DEBUG ) { Log . d ( TAG , "cancelPotentialWork - cancelled work for " + data ) ; } } else { return false ; } } return true ; }
returns true if the current work has been canceled or if there was no work in progress on this image view . returns false if the work in progress deals with the same data . the work is not stopped in that case .
