mPhotoTask.setImageDecodeThread(Thread.currentThread()); String imagePath = mPhotoTask.getLocalPath(); if (imagePath == null) { mPhotoTask.handleDecodeState(DECODE_STATE_FAILED); return; mPhotoTask.handleDecodeState(DECODE_STATE_STARTED); int targetWidth = mPhotoTask.getTargetWidth(); int targetHeight = mPhotoTask.getTargetHeight(); mPhotoTask.handleDecodeState(DECODE_STATE_FAILED); mPhotoTask.setImage(returnBitmap); mPhotoTask.handleDecodeState(DECODE_STATE_COMPLETED); mPhotoTask.setImageDecodeThread(null);