public static boolean cancelPotentialWork(Object data, ImageView imageView) { final ImageAsyncTask task = getImageAsyncTask(imageView); if (task != null) { final Object bitmapData = task.getData(); if (bitmapData == null || !bitmapData.equals(data)) { task.cancel(true); } else { return false; } } return true; }