public void setOnCancelListener ( OnCancelListener listener ) { synchronized ( this ) { waitForCancelFinishedLocked ( ) ; if ( mOnCancelListener == listener ) { return ; } mOnCancelListener = listener ; if ( ! mIsCanceled || listener == null ) { return ; } } listener . onCancel ( ) ; }
Sets the cancellation listener to be called when canceled .