Code example for CancellationException

0
   { 
      Log.e(TAG, "Unable to save ", dialogException);
      mErrorDialogException = dialogException;
      mErrorDialogMessage = dialogErrorMessage;
      cancel(false);
      throw new CancellationException(dialogErrorMessage);
   } 
    
   @Override 
   protected void onPreExecute() 
   { 
      mProgressListener.started();
   } 
    
   @Override 
   protected Uri doInBackground(Uri... params)
   { 
      Uri importUri = params[0];
      determineProgressGoal( importUri);
      Uri result = importUri( importUri );
      return result;