/** * Cancels the current load but does not release any resources held by the request and continues * to display the loaded resource if the load completed before the call to cancel. * * <p> Cancelled requests can be restarted with a subsequent call to {@link #begin()}. </p> * * @see #clear() */ private void cancel() { assertNotCallingCallbacks(); stateVerifier.throwIfRecycled(); target.removeCallback(this); if (loadStatus != null) { loadStatus.cancel(); loadStatus = null; } }
/** * Cancels the current load but does not release any resources held by the request and continues * to display the loaded resource if the load completed before the call to cancel. * * <p> Cancelled requests can be restarted with a subsequent call to {@link #begin()}. </p> * * @see #clear() */ void cancel() { assertNotCallingCallbacks(); stateVerifier.throwIfRecycled(); target.removeCallback(this); status = Status.CANCELLED; if (loadStatus != null) { loadStatus.cancel(); loadStatus = null; } }